Hello all, I've been using the forum search to answer my questions thus far with great success (and the Script Functions page of the wiki with even greater success) but I've been unable to find a solution to my latest problem, and am wondering if anyone else has managed it or if such a thing is even possible in the HPL2 engine.
I'm currently working on a custom story entitled "Whiteout", and a major mechanic in the introductory map is the cold, which will gradually freeze the player to death if (s)he does not find a place of relative warmth*. Towards the end of the map, the player is able to place an ember into a bucket and carry it around as a mobile source of warmth and light (and therefore sanity), allowing them greater freedom of movement and less time spent running between warm spots.
My issue is that I have been thus far unable to move the ember's light and warmth area with the ember, which uses the Coal entity and physics to better simulate actually moving a very hot object rather than sticking it in the player's inventory (in fact, touching it with one's hand burns the player).
If there were a way to do this with a light (hypothetically "EmberLight"), area ("WarmArea") and entity ("Ember"), how might it be done? And would it utilize primarily the Level Editor, script, or should I modify the entity's properties in the Model Editor (I am comfortable with this, though I have relatively little experience with model editing).
Thanks in advance for any help. I can post snippets of code or whatnot as needed.
*I realized later just how similar this was to the opening scene in Penumbra: Overture. The scene itself is very different, but the freezing mechanic is apparently not an original concept... which may be why it was so simple to implement.
EDIT: I have been able to attach a light using the model editor. The area remains a challenge.
Alternately, is there a way to check the player's distance from an object via scripts? For example,
if (GetEntityDistance("Player", "Ember") >= 3)
{
//Do stuff.
}
else
{
//Do other stuff.
}
or something similar?
I believe that would be even easier to work with, but I can't find anything along those lines on the Script Functions page.
Answered my own question. There isn't a script designed to perform such a check. It might come down to filling the entire map with script areas and damaging the player if they're not in the same area as the ember, but GetEntitiesCollide doesn't appear to function in the way I thought it did. :S So I'm rather stuck. Any help or suggestions appreciated.