Frictional Games Forum (read-only)
[SCRIPT] Any way to temporarily enable "God Mode"/Immune to damage? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Any way to temporarily enable "God Mode"/Immune to damage? (/thread-20652.html)



Any way to temporarily enable "God Mode"/Immune to damage? - Cyfiawn - 03-07-2013

I have a map where the player is in a tranquil environment, with no enemies, but still takes falling damage. Is there a way to make the player immune to damage for this level?

I see in the config you can set regen rates, but I'd prefer if there was no blood splatter at all from falling damage.

Thanks,

Cyfiawn


RE: Any way to temporarily enable "God Mode"/Immune to damage? - PutraenusAlivius - 03-07-2013

You need a full conversion to that, as making the player immune to damage requires you to meddle with the game's scripts. As for blood spatter......i think you have to edit the decal for that. Again, needs a full conversion as it meddles with the game's decal and scripts.


RE: Any way to temporarily enable "God Mode"/Immune to damage? - Cyfiawn - 03-07-2013

Ok, that was the answer I was expecting, but didn't want. Tongue

I assume there is no way to edit the config file via a script either?

A last resort would be to "SetPlayerHealth(100);" on a loop throughout the whole level.


RE: Any way to temporarily enable "God Mode"/Immune to damage? - Kreekakon - 03-07-2013

I'm not really sure what you mean. Do you mean that you want the player to be immune from damage the whole level, but still take fall damage? If so, why do you need the player to be completely immune to damage?

There might be a work-around to this, but I need to be sure what it is you want.


RE: Any way to temporarily enable "God Mode"/Immune to damage? - Cyfiawn - 03-07-2013

(03-07-2013, 11:43 AM)Kreekakon Wrote: I'm not really sure what you mean. Do you mean that you want the player to be immune from damage the whole level, but still take fall damage? If so, why do you need the player to be completely immune to damage?

There might be a work-around to this, but I need to be sure what it is you want.

I want the player to be immune to all damage. It's just that the only damage the player can take during this level currently is fall damage, if that makes it easier.


RE: Any way to temporarily enable "God Mode"/Immune to damage? - Kreekakon - 03-07-2013

Well, in that case, I can't think of any way you'd be able to do that normally without a full conversion.

There are two ways to solve this if your level allows it though:
1. Design the level so that no heights will allow for fall damage to happen.
2. Teleport the player to a safe place if he is falling from a height that will cause fall damage to happen.


RE: Any way to temporarily enable "God Mode"/Immune to damage? - Cyfiawn - 03-07-2013

(03-07-2013, 12:33 PM)Kreekakon Wrote: Well, in that case, I can't think of any way you'd be able to do that normally without a full conversion.

There are two ways to solve this if your level allows it though:
1. Design the level so that no heights will allow for fall damage to happen.
2. Teleport the player to a safe place if he is falling from a height that will cause fall damage to happen.

Neither of these are really an option, unfortunately. I'll have to go with a SetPlayerHealth(100) on a loop to trigger every 0.5 seconds, or so.


Thanks for the replies, though. Appreciate it. Smile

Cyfiawn


RE: Any way to temporarily enable "God Mode"/Immune to damage? - FlawlessHappiness - 03-07-2013

If you have monsters, how about editting them, so they deal 0 damage.


RE: Any way to temporarily enable "God Mode"/Immune to damage? - Adrianis - 03-07-2013

If your design allows for it, you could apply a large amount of force on the positive Y axis to the player essentially counter-act the amount of gravity for the player, so that when they fall it is slow enough to not take damage. That kinda requires them being in a low-gravity environment, or some kind of dream-world where normal world physics don't apply.