View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:20 am



Reply to topic  [ 6 posts ] 
 Help, indexing existing AEmitters 
Author Message
User avatar

Joined: Wed May 20, 2009 3:10 pm
Posts: 366
Location: Århus, Denmark
Reply with quote
Post 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.


Mon Feb 07, 2011 8:23 am
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post 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.


Mon Feb 07, 2011 10:29 am
Profile
User avatar

Joined: Wed May 20, 2009 3:10 pm
Posts: 366
Location: Århus, Denmark
Reply with quote
Post Re: Help, indexing existing AEmitters
Hitmos and gethitbymos is set to 1, so well I am out of ideas :/


Mon Feb 07, 2011 5:03 pm
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post 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.


Mon Feb 07, 2011 5:48 pm
Profile
User avatar

Joined: Wed May 20, 2009 3:10 pm
Posts: 366
Location: Århus, Denmark
Reply with quote
Post Re: Help, indexing existing AEmitters
Didn't work, same result :/


Mon Feb 07, 2011 5:59 pm
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post 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.


Mon Feb 07, 2011 7:40 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.051s | 14 Queries | GZIP : Off ]