View unanswered posts | View active topics It is currently Sun Oct 21, 2018 12:33 pm



Reply to topic  [ 7 posts ] 
 Area and Waypoint woes 
Author Message

Joined: Mon Sep 08, 2008 5:49 am
Posts: 8
Reply with quote
Post Area and Waypoint woes
I have dummies spawning at one end of the map and they are set to go after the players brain. This works fine but I want to make it so that if the dummies fall down this pit I have they change their mind and go to a certain point. I have no problems with making them go to a certain point but I am having slowdown with the method for making their AI change.

As they fall down the pit they pass through an area, it currently checks if there are actors of the CPU team in that area and if there are it removes all current waypoint information, sets their AI mode to go to and tells them where to go. This all works fine but there is so much redundant re-pathing going on that it causes a FPS hit.

Is there any way I can make it only change each actors AI mode and waypoint information once and stop it repeating the same action for the same actors time and time again?

Cheers.


Sun May 17, 2009 8:56 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Area and Waypoint woes
have it set a local variable "haschanged = 1" whenever it changes, and then add an if to the original AI change statement for haschanged = 0.

EDIT well actually it'd be haschanged = nil since it wouldn't exist on teh actors


Sun May 17, 2009 11:46 pm
Profile

Joined: Mon Sep 08, 2008 5:49 am
Posts: 8
Reply with quote
Post Re: Area and Waypoint woes
Cheers for the reply.

So you have assign variables to actors? Or am I missing something?


Mon May 18, 2009 12:53 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Area and Waypoint woes
Just add this line inside the part that changes the AI's waypoint:

local hasnewAI = 1;

And then add this if statement before the part that changes AI:

if hasnewAI = nil then


Mon May 18, 2009 1:53 am
Profile

Joined: Mon Sep 08, 2008 5:49 am
Posts: 8
Reply with quote
Post Re: Area and Waypoint woes
It's sort of worked but now if an actor gets stuck inside said area the FPS still drops as with every call to UpdateActivity() it loops through all bots and for those inside the area it clears all waypoints and finds it a path to the second objective. It' all this redundant pathing that's the problem

Is there any way I can perform a change in AI for any actor who enters a specific area but only once per actor?


Mon May 18, 2009 2:44 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Area and Waypoint woes
That's what that should accomplish.

As I've failed I now refer you to the people who actually know CC lua.

By refer you to I mean I'll wait here until they show up.


Mon May 18, 2009 2:57 am
Profile

Joined: Mon Sep 08, 2008 5:49 am
Posts: 8
Reply with quote
Post Re: Area and Waypoint woes
Cheers all the same, I didn't and don't mean to sound ungrateful so I apologise if that's how I seemed.


Mon May 18, 2009 3:49 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.016s | 17 Queries | GZIP : Off ]