Game Development Community

Advanced Version: SimGroups

by Rex · in Torque Game Engine · 09/16/2005 (7:43 am) · 13 replies

I'm trying to follow the AI section[Chapter7], and with using the engine and Resources provided in the A3D folder with the demo.exe; I can't place/create the needed SimGroup from the F4 World Editor Creator. Odd, when I try on all my other copies of TGE[my SDK included, it functions fine...]

Anyone else having this issue with the Resources? I can't create any types of Mission/Environment/or System objects, but I can place Interiors,Shape, & Static Shapes, but nothing beyond that...is that portion of the demo's UI disabled??

Used it as the book describes in the MODdemo of my SDK repository and I get them to spawn, but they don't recognize me as an enemy or open fire. All I did was take the RESOURCES/Ch7/aiGuard.cs and dropped it into my demo/server/scripts folder. Added the exec statement and the scheduled thecalling for "CreateBots"....they arrive; however very passive.

About the author

Rex does all his 3D graphics through BrokeAssGames and is currently working on DSQTweaker, Ecstasy Motion, and other interesting projects yet to be revealed. Just ask him about anything DTS/DSQ related, he's happy to help.


#1
09/19/2005 (1:32 am)
I'm having the same problem in the SDK - the ch7 code needed to get changed from LightMaleHumanArmor to PlayerBody to work in the TGE SDK, but after that guards just stand around being dopey, and you can't kill them.... (edit - unkillability is because it uses a "NPC" class - D'Oh!)

I got stuff placed the same in the demo version, but the guard seems just as invincibly clueless there as well.
#2
09/19/2005 (7:04 pm)
Got it working - two bugs cause the guards to mess up - well shooting-wise - if you want to kill the guards, you need to comment out "classname = 'NPC'", or add NPC class functions.:

Line 428, aiGuard.cs:

%relbearing = %this.GetRelativeBearing(%this,%that);

should be

%relbearing = %this.GetRelativeBearing(%that);

---------------------------

Line 430, aiGuard.cs:

if ( (%relbearing > -($ARC_OF_SIGHT/2)) && (%relbearing < -($ARC_OF_SIGHT/2)) )

should be:

if ( (%relbearing > -($ARC_OF_SIGHT/2)) && (%relbearing < ($ARC_OF_SIGHT/2)) )

--------------------------
#3
09/20/2005 (6:09 am)
Thanks Paul!

Boy, is my wife gonna be mad at me!

BTW - the line 430 error exists only on the CD, it's not in the book code.
#4
09/20/2005 (4:54 pm)
The aiPlayerAddenum.cs CD file has similar bugs:

%player.followPath("MissionGroup/Paths/PathA");

should be

%player.followPath("MissionGroup/Paths/PathA", -1);

in InsertPathedAI()
or

%player.followPath("MissionGroup/Paths/PathA", 2);
...
%player.followPath("MissionGroup/Paths/PathA", 1);

in InsertPathedAIShooter()

Theres also a bunch of lines missing from the CD InsertPathedAIShooter() that are in the book.

Also Fig 7.7 and Fig 7.8 show Path patha without a Paths SimGroup.
#5
09/24/2005 (4:20 pm)
Thanks! I got it working also. I changed the className to "Armor" instead of commenting it out; alas I think that generated a warning on a callback to onDeath to play the audio, whereas the deathAnimation worked fine. It got them dying and deleting their Health on the HUD. Their aim seemed a bit low, I stood on the steps of the Great Hall, and the one Orc I left standing kept firing some yards in from of my position, I guess standing on the .diff may have made the difference?? All in all it now works!

I'm more concerned why I can't create any of the SimGroups...and only with the included Resources. All my other copies of the TGE[and I have many floating around] work just fine, although I do have a Project I was working on that did funny things when run at less than max resolution. It may have had the lighting pack with it.
#6
10/15/2005 (7:29 pm)
@Paul

Thanks! You are my savior!
#7
10/19/2005 (9:43 am)
Do you have to use the aiGuard.cs from the book. Can you use the existing aiGuard.cs from TGE 1.3 engine. Im trying to use it but when it loads and orc starts to run and stops and then freezes. Any suggestios? Using existing aiGuard.cs
#8
10/26/2005 (7:40 am)
Thanks guys.
#9
11/15/2005 (7:20 am)
PITA, ive been debugging this for about 2 days and posting with no reply, then I searched on getrelitivebearing and found this, exactly the same problems i ve been having, and heres the answers in a nut shell. great!. I did learn a lot from the experience though. Is there a specific page that lists all known faults with the book. Nothing worse that trying to learn somthing and its bugged in the first place.
#10
11/26/2005 (8:07 am)
I've had the same issues but found out how to fix the SimGroup prob. The issue is that when you copy files from the CD they will have the read only attribute set as they were read only on the CD. When you create a SimGroup Torque writes to the \editor\newObject.cs file, if it's read only it will fail, so just clear the read only flag and it works fine.
#11
11/26/2005 (9:00 am)
Thanks, Pete! I'll give this a try and see what happens...wondered what that newObjects.cs script was?? seems something new from 1.3?? We run a CVS and I keep getting some errors about that file, needs to be ignored...thanks again for poking around.

PS-it worked perfectly. SimGroup created just fine. Well, let me try another resolution and perhaps windowed and that'll be the true test.
#12
12/19/2005 (10:51 pm)
I've recently gotten this working as well... but in my project, like Rex's, my guards are shooting really low. Actually, so low that I had to switch out their weapons to something less explosive than the crossbow because they kept killing themselves by shooting out their own feet. I'm using my own models, as opposed to Kork ...can anyone tell me how in the script to adjust this?
#13
02/03/2006 (10:28 am)
Wow, I wish I could have found this post before I tracked down all these errors.
One other I noticed is that if you select all the spawnpoints at once in the editor as described in the book and add the 4 dynamic fields, it only adds it to the last one selected. I had to go back and add them one at a time.

@Chris:
see this post about bots aiming at feet, note that the solution that involves engine changes seems to have been implemented in TGE 1.4
www.garagegames.com/mg/forums/result.thread.php?qt=19984