Game Development Community

Possible to Add AIPlayer completely in editor, and set it on a path?

by Jaimi McEntire · in Torque 3D Professional · 08/03/2009 (7:33 pm) · 7 replies

Is it possible to add an AiPlayer completely in the editor? I tried creating a SpawnSphere, and setting the following properties on it:

new SpawnSphere() {
spawnClass = "AIPlayer";
spawnDatablock = "DemoPlayer";
autoSpawn = "1";

But nothing happened. Does anyone know how to do this, and to get them set on a path?
Currently, I'm just sticking it in code to create the AIPlayers manually.


#1
08/03/2009 (11:48 pm)
I suggest that you look at this ressource www.garagegames.com/community/resource/view/15320/5#comments

This will give you good hint to do that.

More, this AIPlayer is clearly more advanced than the basic one and this may benefit to your game
#2
08/04/2009 (3:37 am)
Well, what did you set his path=? according to the datablock provided it had not yet been placed on a path to walk on. Where are the functions to tell it to walk to the next node? To start walking at all? To think? Provide that information and perhaps we can help you further.
#3
08/04/2009 (4:46 am)
Hey Guys, thanks for the input. But I guess I'm not asking clearly. Yes, I am aware there are a ton of resources to create AiPlyers in script, I've even worked on some of them. But I am asking - is it possible (in the FPS Genre Kit that ships with B4) to completely create the ai player in the world editor and assign it a path. I didn't dig into the SpawnSphere code yet, but it looked like there might be just from looking at the properties. Perhaps there is not a way with the current setup.
#4
08/04/2009 (7:51 am)
For drop in via the editor wouldn't you have to script a listing under Library/Scripted? (kinda like adding StaticShapes)

And then have the yourAIobjectData.cs kickstart the AIPlayer function or you'd just have it sat there doing nothing ... actually maybe not, if you could tie the editor into the AIPlayer.cs create player function (can't remember if the stock one has it? Surely it must...).

I thought about this before but haven't got around to messing with the GUIs or modding the Editors. I spawn all my (custom)AI via triggers.

EDIT: Just thought, the player spawns from spawn.cs (somewhere in game/core) which has all the info on which spawnpoints to use, so copying and execing that (or maybe just adding to it) to include AIplayer attributes should work. Though that would spawn the AI/s at the load, just like the player.
#5
08/04/2009 (8:26 am)
It's a good question, and I would almost wat to say yes. The spawn logic has changed a few times over the betas, but an early experiment that I did allowed me to spawn different types of bots sort of like how the AI Marker Editor worked for the Improved AIGuard Resource.

Back then the spawn objects were not hooked up in the editor so I had to fill in all of the "options" manually (spawnClass, spawnDatablock, spawnScript, spawnProperties). I had changed the AIManager to look for types of spawn objects as well as Paths -- and it worked rather well... then.

But now... I'm not so sure. While helping someone setup their spawnpoints for vehicles recently I noticed that the GUI/Editor/Tool team only accounted for the Player class for the spawn objects, with the exception of Observer Drop Points for cameras.

Surely it wouldn't take much to reproduce my early experiments, but at this time nothing further has been done or included in any of the demos or projects.
#6
08/04/2009 (9:25 am)
I am at work at lunch but can look when I get home. There is a variable called pauseSim or something like that.


I modified my editor function so it pauses the sim on editor enter and restarts when you leave. In that way you don't have to mess around with AI Markers, you simply drop the AI in, select a path and when you hit F11 they start following it.

I have been wanting to eliminate that container search and AI marker settings for a long time. I did something similiar in TGEA, but I found the pauseSim in T3D much easier.

Not sure if that is what you are looking for or not, if it is I will check correct variable when I get home.
#7
10/05/2009 (6:16 pm)
Anyone ever find out if this was possible?