Game Development Community

Adding Monsters?

by Terry Kingston · in RTS Starter Kit · 04/29/2005 (3:48 pm) · 4 replies

Im trying to do an RPG game starting with the RTS kit.

my question is:

what is the best way to add monsters to the game?

im new to torque and want to get off on the right foot. should i make them based on the RTSUnit? or set up a completely new type? and if so, how do i? or should i make a connection just for the npcs? how do i do that?

i probably don't sound like i know what im talking about, :)
but i hope im putting my question across so it makes sense..

i still want to keep the option of multiplayer. so all the players will encounter the same monsters and such...

#1
04/29/2005 (4:36 pm)
In my oppinion the NPCS should have there own server and they can be RTSUnit.

EDIT: Since your game will probrally have one server or P2P just make them owned by the server.
#2
04/29/2005 (4:59 pm)
Makes sense..

how do i do that?
#3
04/29/2005 (5:49 pm)
Although I never read it I have to suggest you read the book by Ken Finney search for it on the forums. Basically just spawn units with a team different from all other player teams. Look in forums for how to spawn RTSUnits.
#4
05/09/2005 (1:25 pm)
Tried and failed, please help.

ok, here is what I did...

in Server.cs at the bottom of the create server function

%AIConnection = new AiConnection(ServerConnection);
   echo("creating the AI player!!!! " @ %AIConnection.getID());
   %AIConnection.setConnectArgs("Mobs");
   %AIConnection.connectLocal();

then in game.cs in oncliententergame function i put...

%this.createplayer(%spawnpoint, %index)

which is the same one it uses to spawn the players guys.


but.. i ran into a problem. It crashes soon as it tries to spawn the player's units. I found that it is the following line that crashes it.

%player.setcontrollingconnection(%this)

but it is when it does it for the player's units. if i comment that line out, it starts fine (but i cant see the guys cuz i dont controll them..)

anyway.. I need some help. Im pretty sure it's cuz im connecting both the player and the AI player using the connectlocal() function. but i haven't found a better way, and I don't know enough to make my own. :(