The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Entity-connected lights and areas (solved)
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#1
Question  Entity-connected lights and areas (solved)

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. Undecided

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.

[Image: at_9365860.png]

Follow Harvest.
(This post was last modified: 02-02-2011, 03:04 AM by Phoroneus.)
02-01-2011, 05:16 PM
Find


Messages In This Thread
Entity-connected lights and areas (solved) - by Phoroneus - 02-01-2011, 05:16 PM



Users browsing this thread: 2 Guest(s)