Re: Ask a simple question, get a simple answer
Posted: Thu Jan 10, 2019 11:48 pm
Did you remember to place a HeightmapComponent on the level?
Official Legend of Grimrock Forums
http://mail.grimrock.net/forum/
Code: Select all
if human_knight_4.monster:getHealth() <= 200 then
human_knight_4.basicattack:enable()
end
It's not that.THOM wrote: ↑Wed Jan 23, 2019 2:51 am Okay - so far, so good.
But I don't understand why someone should let you attack him until he is half dead. Especially if he is a knight.
Wouldn't it be enough if they never attack the party, even standing next to them? And then start fighting as soon as they got harmed? Would be the behaviour I would expect - and it still fits with your story.
But I have absolutely no idea how to do that, and my "buffer" health pools is basically a practical solution that simply works and offers protection against user stupidity at the same time.Isaac wrote: ↑Wed Jan 23, 2019 5:19 am You might consider implementing an entity class (or a mixed set) based faction that allows the monster to check (and alter) the party's local reputation. That way each and every attack can (to anyone) can act as a mark against them, and cause any among the concerned faction to change their behavior towards them.
This could be as simple as counter that indicates the town as neutral/guarded/hostile—ie. three strikes and you're out... or complex; as in a shining reputation could see them treated well, and with any altercations causing colder treatment, and cautionary warnings, before outright hue & cry for their deaths.Even looting containers (that they shouldn't) could give them a few strikes against their rep.
One way to do this is to use a Boss entity, a counter, and then a script to 'increase' the counter when the player attacks an NPC and 'decrease' when they help via some means. You'll need to place a monster in some part of the map where the players can't reach as a 'token' and have set it's hp to the value you want for the players 'reputation' with the NPC's.Pompidom wrote: ↑Wed Jan 23, 2019 12:11 pm
But I have absolutely no idea how to do that, and my "buffer" health pools is basically a practical solution that simply works and offers protection against user stupidity at the same time.
Offering multiple playthroughs at the same time with different experiences and different endings.
Everything I want to achieve can basically be done with a bunch of timers/triggers/scripts that I understand.
Code: Select all
function NPCReputation()
if Reputation_counter_1.counter:getValue() == 0 then
Reputation_Monster.monster:setHealth(1000)
human_knight_4.basicattack:disable()
elseif Reputation_counter_1.counter:getValue() == 1 then
Reputation_Monster.monster:setHealth(800)
elseif Reputation_counter_1.counter:getValue() == 2 then
Reputation_Monster.monster:setHealth(600)
elseif Reputation_counter_1.counter:getValue() == 3 then
Reputation_Monster.monster:setHealth(400)
elseif Reputation_counter_1.counter:getValue() == 4 then
Reputation_Monster.monster:setHealth(200)
elseif Reputation_counter_1.counter:getValue() == 5 then
Reputation_Monster.monster:setHealth(0)
ReputationMonsterboss.bossfight:deactivate()
Reputation_Monster.monster:die(true)
human_knight_4.basicattack:enable()
end
end
Code: Select all
for i = 1, X do
local NPC_Group = findEntity("NPC_"..i)