PDA

View Full Version : help me spawn correctly


legacy-kevinvee
07-12-2003, 11:39 AM
Hi. I've been doing mods of ut2k3 for the past year for a research group at my university, and one of the things I've had to consistently deal with is spawning a particular type of pawn at a particular point.
The solution (hack?) I was using before was to create subclasses of PlayerStart for each point, and then in the game class see if each of these points had spawned as many of their particular types of bot as desired.
At this point I am undertaking a new project which would be much better if this start code didnt have to be placed in the game class, and they could just place a pawn directly in to their level.
It doesn't appear that PreBeginPlay is getting called with this placed pawn, and I think it is acting more like a static mesh than anything... I can paste code if needed, but I would rather learn the proper way to associate a controller (subclassed from AIController) with a placed pawn (subclassed from xPawn). I have set the obvious ControllerClass and Pawn class in my classes as I did before when spawning from my start positions.
Thanks much for your words of advice.

legacy-kevinvee
07-12-2003, 02:31 PM
Ok, it does look like the PreBeginPlay of the placed pawn is being called, but the Pawn isnt properly associated with its intended Controller class... any suggestions on how to achieve this?

legacy-Mr Evil
07-12-2003, 02:37 PM
Look at PostBeginPlay in the Pawn class, paying particular attention to this comment:
// NOTE: pawns spawned during gameplay are not automatically possessed by a controller
Therefore you will have to spawn the appropriate controller yourself and call its Possess function to get it to control the pawn.