Jump to content

Most efficient way to detect lightlevel on a actor


mrdoodle

Recommended Posts

Posted

So I have these illusions that pop up according to my will.

They are actors copied from where you've been, with a weakness to light.

 

When I attack them it is quite simple to detect the lightlevel; I just run a Onhit() event with the lightlevel calculation on a magiceffect script on the actor, and then kill the actor if above a certain threshold. The onhit event feels efficient for it's purpose.

 

The hard part comes when I want the actor to react to lights not Onhit(). The sun and general lighting I can just do a check on myself, or go by the game hour.

But what is the most effecient way to deal with light from torches, lanterns and other non-combat light sources?

 

I have, on tests, made a while loop that runs the same lightlevel detection until it goes above a threshold or until a timer zeroes. This works good enough, but I don't really know how that affects the script engine and so on.

 

Is it better with just going with Onupdate() every 0.5 seconds? How low can I realistically go?

Or a cloak? I really want to avoid cloaks since I already uses MGEs on every illusion.

 

I have made no success with quests on this part, sadly.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...