Data Realms Fan Forums
http://45.55.195.193/

Help, indexing existing AEmitters
http://45.55.195.193/viewtopic.php?f=73&t=21423
Page 1 of 1

Author:  akblabla [ Mon Feb 07, 2011 8:23 am ]
Post subject:  Help, indexing existing AEmitters

I have a problem I have made this simple search and indexing code, but it won't find any of my existing "Teleporter Texture B"s. The "Teleporter Texture B"s are placed in the scene it self. I have tried to run the script in the first updated frame instead of StartActivity(), but the same results.
Code:
  --teleporter

   self.Teleporter = {};

  local teleporternumber = 1
 
  for actor in MovableMan.Particles do
    if string.find(actor.PresetName, "Teleporter Texture B") == true then
      self.Teleporter[teleporternumber] = actor
      teleporternumber = teleporternumber + 1
    end
  end


It works when i am defining the teleporters in the script itself instead of inside the scene, so it shouldn't be anything else than this part.

Author:  none [ Mon Feb 07, 2011 10:29 am ]
Post subject:  Re: Help, indexing existing AEmitters

First off you can save using a local by using:

Code:
  --teleporter

   self.Teleporter = {};
 
  for actor in MovableMan.Particles do
    if string.find(actor.PresetName, "Teleporter Texture B") == true then
      self.Teleporter[#self.teleporter + 1] = actor
    end
  end


but that won't solve your problem which is, I think you have set hitsmos and getshitbymos to 0 therefore just like feet and hands it can not be found or altered by lua.

Author:  akblabla [ Mon Feb 07, 2011 5:03 pm ]
Post subject:  Re: Help, indexing existing AEmitters

Hitmos and gethitbymos is set to 1, so well I am out of ideas :/

Author:  none [ Mon Feb 07, 2011 5:48 pm ]
Post subject:  Re: Help, indexing existing AEmitters

Ohh oh I know

Code:
  --teleporter

   self.Teleporter = {};
 
  for actor in MovableMan.Particles do
    if actor.PresetName == "Teleporter Texture B" then
      self.Teleporter[#self.teleporter + 1] = actor
    end
  end


Will work but string.find returns a number not a boolean.

Author:  akblabla [ Mon Feb 07, 2011 5:59 pm ]
Post subject:  Re: Help, indexing existing AEmitters

Didn't work, same result :/

Author:  none [ Mon Feb 07, 2011 7:40 pm ]
Post subject:  Re: Help, indexing existing AEmitters

did you set getshitbymos to 1?

it should work, it is an AEmitter right?

I tested it in zombie mission finding the zombie generators, they are placed via lua are you using soplace, it should work with both.

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