Data Realms Fan Forums
http://45.55.195.193/

A little help with areas?
http://45.55.195.193/viewtopic.php?f=73&t=14669
Page 1 of 1

Author:  Vattic [ Sat May 16, 2009 2:14 am ]
Post subject:  A little help with areas?

I've got a script where it checks if there are any CPU actors in a given area and if there aren't it generates some, but it isn't doing this. I've only been messing around with Lua and CC modding today but I've figured out some of the basics and get the impression I'm just missing something obvious.

Here is what checks for CPU units.
Code:
for actor in MovableMan.Actors do
   if actor.Team == Activity.TEAM_2 and self.SpawnZone:IsInside(actor.Pos) then
      self.SpawnZone = false;
   end
end
I wont post my whole file as its rather lengthy. It starts by setting self.SpawnZone = true. Then it loops through all actors and if there are any in team 2 and who are inside the given area it sets self.SpawnZone = false. If after this self.SpawnZone == true then it creates a new squad of Dummies. If that makes sense.

The console throws up an error on line:
Code:
if actor.Team == Activity.TEAM_2 and self.SpawnZone:IsInside(actor.Pos) then
Quote:
attempt to index field 'SpawnZone'(a nil value)

Can anyone see where I'm going wrong?

Author:  mail2345 [ Sat May 16, 2009 5:28 am ]
Post subject:  Re: A little help with areas?

EDIT:
Oops, misread.

Author:  Daman [ Sat May 16, 2009 7:31 am ]
Post subject:  Re: A little help with areas?

Because I don't have the entirety of your code, I don't know(http://pastebin.com).

But the error is coming from SpawnZone not existing.

Author:  Vattic [ Sat May 16, 2009 9:59 pm ]
Post subject:  Re: A little help with areas?

Cheers Daman it seems the problem was me writing when tired, woke up this morning realising I had two different names for the same area... ah well, it works fine now.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/