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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to teleport when enemy hits you?
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#11
RE: Is it possible to teleport when enemy hits you?

There's no callback for the player being damaged to be redirected for player movement, Tanshaydar?
08-18-2011, 02:53 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#12
RE: Is it possible to teleport when enemy hits you?

AddEntityCollideCallback("Player", "Monster", "Func01", false, 1);

void Func01(string &in asParent, string &in asChild, int alState)
{
Giveplayerdamage....
fadeout...
TeleportPlayer...
}


Is that clear enough? This is a simple workaround and needs some work to be polished.

(This post was last modified: 08-18-2011, 02:56 PM by Tanshaydar.)
08-18-2011, 02:56 PM
Website Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#13
RE: Is it possible to teleport when enemy hits you?

(08-18-2011, 02:56 PM)Tanshaydar Wrote: AddEntityCollideCallback("Player", "Monster", "Func01", false, 1);

void Func01(string &in asParent, string &in asChild, int alState)
{
Giveplayerdamage....
fadeout...
TeleportPlayer...
}


Is that clear enough? This is a simple workaround and needs some work to be polished.

Maybe I will try this one.

“Life is a game, play it”
08-18-2011, 03:06 PM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#14
RE: Is it possible to teleport when enemy hits you?

Wouldn't a collide check work even if you run up behind the enemy and knock into him, though?
08-18-2011, 03:45 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#15
RE: Is it possible to teleport when enemy hits you?

you could use the GetPlayerHealth(); and bind it to a variable. Then have a timer check after collision wheter that variable has been lowered.

[Image: mZiYnxe.png]


08-18-2011, 06:29 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#16
RE: Is it possible to teleport when enemy hits you?

(08-18-2011, 06:29 PM)Acies Wrote: you could use the GetPlayerHealth(); and bind it to a variable. Then have a timer check after collision wheter that variable has been lowered.

Can you show me that script? I need this now! I dont know how to do this... Too confusing for me.

“Life is a game, play it”
08-18-2011, 09:19 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#17
RE: Is it possible to teleport when enemy hits you?

(08-18-2011, 09:19 PM)HumiliatioN Wrote:
(08-18-2011, 06:29 PM)Acies Wrote: you could use the GetPlayerHealth(); and bind it to a variable. Then have a timer check after collision wheter that variable has been lowered.

Can you show me that script? I need this now! I dont know how to do this... Too confusing for me.

If you were to consider that method, you should take into consideration situations where the player is careless enough to hurt themselves (e.g. falling off tall platforms). You'd also have to take into consideration that enemy damage randomizes. It might one time take some damage off the user, take most damage off the user, or kill the user in one hit.

Tutorials: From Noob to Pro
08-18-2011, 09:29 PM
Website Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#18
RE: Is it possible to teleport when enemy hits you?

(08-18-2011, 09:29 PM)Your Computer Wrote:
(08-18-2011, 09:19 PM)HumiliatioN Wrote:
(08-18-2011, 06:29 PM)Acies Wrote: you could use the GetPlayerHealth(); and bind it to a variable. Then have a timer check after collision wheter that variable has been lowered.

Can you show me that script? I need this now! I dont know how to do this... Too confusing for me.

If you were to consider that method, you should take into consideration situations where the player is careless enough to hurt themselves (e.g. falling off tall platforms). You'd also have to take into consideration that enemy damage randomizes. It might one time take some damage off the user, take most damage off the user, or kill the user in one hit.

The falling would be an issue. At least if it wasn't an obvious spot from which the player fell, in that case you could place a script area at the bottom of the fall which redefines the health variable. The amount of damage the monster does would not matter, as any given difference would result in a teleport. The only issue would be death, but that could perhaps be solved by checkpoints?

[Image: mZiYnxe.png]


08-18-2011, 09:52 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#19
RE: Is it possible to teleport when enemy hits you?

(08-18-2011, 09:52 PM)Acies Wrote:
(08-18-2011, 09:29 PM)Your Computer Wrote:
(08-18-2011, 09:19 PM)HumiliatioN Wrote:
(08-18-2011, 06:29 PM)Acies Wrote: you could use the GetPlayerHealth(); and bind it to a variable. Then have a timer check after collision wheter that variable has been lowered.

Can you show me that script? I need this now! I dont know how to do this... Too confusing for me.

If you were to consider that method, you should take into consideration situations where the player is careless enough to hurt themselves (e.g. falling off tall platforms). You'd also have to take into consideration that enemy damage randomizes. It might one time take some damage off the user, take most damage off the user, or kill the user in one hit.

The falling would be an issue. At least if it wasn't an obvious spot from which the player fell, in that case you could place a script area at the bottom of the fall which redefines the health variable. The amount of damage the monster does would not matter, as any given difference would result in a teleport. The only issue would be death, but that could perhaps be solved by checkpoints?

There is not any falling. Just when "Bad Dream begins" I woke up hallway then monster begans to chase me then front and behind the monster doors are locked only way to teleport and survive is face the monster and I have "Full health and sanity" then One hit and WUMP teleport happens.

I dont know just how to script this one.

“Life is a game, play it”
08-18-2011, 10:09 PM
Find




Users browsing this thread: 1 Guest(s)