Data Realms Fan Forums
http://45.55.195.193/

Enemies are out of the screen
http://45.55.195.193/viewtopic.php?f=72&t=17239
Page 1 of 1

Author:  Illia [ Sun Nov 29, 2009 11:47 am ]
Post subject:  Enemies are out of the screen

Hi everyone ! I am from Ukraine, so sorry for mistakes in my text :oops:
I have one problem with my Cortex Command, in some of the scenes, that are non cyclic, enemies die out of the screen, so i don't see any of them or their craft. :???:
How can i solve this problem ? :oops:
Thanks.

Author:  Duh102 [ Sun Nov 29, 2009 1:41 pm ]
Post subject:  Re: Enemies are out of the screen

I suppose you could fix it with a simple Lua script. If you have not modded and thus do not know how to attach Lua scripts to actors, then this will not make any sense to you, and you should make a request in the request subforum for it's implementation.

Code:
function Create(self)
  self.sceneBox = Box(0, 0, SceneMan.SceneWidth, SceneMan.SceneHeight);
  self.checkTimer = Timer();
end

function Update(self)
  if self.checkTimer:IsPastSimMS(500) then
    for actor in MovableMan.Actors do
      if not self.sceneBox:WithinBoxX(actor.Pos) then
        actor.Pos.X = Math.random(0, SceneMan.SceneWidth)
      end
    end
    self.checkTimer:Reset()
  end
end


I did not test this, but going by the Wiki it looks to be alright. There may be some errors, such as SceneMan may be SceneManager...

EDIT: Forgot to end Create().

Author:  Illia [ Sun Nov 29, 2009 6:24 pm ]
Post subject:  Re: Enemies are out of the screen

Thank you, but i don't know how to do it :???:
May be you can explain me it on example ?

Author:  Gotcha! [ Sun Nov 29, 2009 6:30 pm ]
Post subject:  Re: Enemies are out of the screen

It's a known bug. My hope is that it'll be solved in B24. :???:

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