How: Enemies attack when attacked..?

builders help builders

Moderator: eTux

Post Reply
User avatar
Howaito
Member
Member
Posts: 349
Joined: 14 Mar 2006 19:21
Location: Inglaterra

How: Enemies attack when attacked..?

Post by Howaito » 27 Aug 2009 04:05

Good evening.
I was wondering if anyone could help me...

I wish to have an enemy which does not attack Lara until she initiates the attack. I think this was possible in TR3 with the guards. However, can it be done so the enemies run away from Lara when triggered?

I know there are the two AI placements, but that is a set path!

Any help would be appreciated... Thank you!
The Cartoon World Returns March MMX

User avatar
Mulf
Senior Member
Senior Member
Posts: 1396
Joined: 04 Oct 2001 00:41

Re: How: Enemies attack when attacked..?

Post by Mulf » 30 Aug 2009 15:21

I believe you want to place an AI_GUARD nullmesh on the square where the baddy is. This makes him stand and wait and only turn in Lara's direction unless he's being attacked, in which case he'll resume standard enemy behaviour. (It's in the manual, btw.)
Note, however, that AI objects were developed for use with BADDY_1, BADDY_2, and SAS. They may not work as well with enemies in other slots.

Marqs
Newbie
Newbie
Posts: 2
Joined: 13 Sep 2009 20:39

Re: How: Enemies attack when attacked..?

Post by Marqs » 13 Sep 2009 23:48

Also:

An enemy in the slot skorpion attacks Lara only if she shoots him.

This enemy does not need AI to behave in that way.

(Sorry, my English is bad.)

User avatar
Fluen
Member
Member
Posts: 941
Joined: 01 Mar 2006 18:37
Location: Elsinore, Denmark

Re: How: Enemies attack when attacked..?

Post by Fluen » 15 Sep 2009 12:34

Wrong!
If there are other enemies around, the scorpion will deal with them first and then attack Lara. If she shoots at it before that, it will attack her immediately. But if there are no enemies around, it will attack her right away.

As far as I know the enemies in TR3 only ran to a certain spot to sound an alarm (a set path) and then attacked Lara. This can still be done in TR4. But I can't help you, if you want an enemy who keeps fleeing and does so in a random direction.
If you have something special in mind, we might be able to help you, if you make a more detailed description and perhaps some pictures/sketches of what you want. Maybe you can also take a look at Richard Lawter's Underworld (the last of them - have forgotten the number). I the factory level Lara produces intelligent plastic (a blue ball with legs). It's intelligent enough to run away, so Lara has to run after it and shoot it. But I don't know how precisely he set this up.

The Troops don't attack Lara, unless she shoots at them. They just wander around at random, but don't flee. And if Lara fires at another kind of enemy, they will assist her attack.

User avatar
Howaito
Member
Member
Posts: 349
Joined: 14 Mar 2006 19:21
Location: Inglaterra

Re: How: Enemies attack when attacked..?

Post by Howaito » 16 Sep 2009 10:25

I don't think having troops in that manner is possible in TR4, is it? If it were, I would have assumed it would work like the guide.
The Cartoon World Returns March MMX

User avatar
Fluen
Member
Member
Posts: 941
Joined: 01 Mar 2006 18:37
Location: Elsinore, Denmark

Re: How: Enemies attack when attacked..?

Post by Fluen » 16 Sep 2009 14:20

They behave exactly the way I have described: they wander around randomly. If Lara shoots at another enemy, they will help her. If another enemy (the scorpion) attacks one of them, his comrades will help him too. If Lara shoots at one of them, at least he will attack Lara. I haven't checked, if all troops seeing Lara shoot at one of them, will react.

The troops slot is made to be a friendly character - it was used in the levels around the Great Pyramid. Have you played that? And I have been testing it with a level in mind.

It actually upsets me that you don't believe what I write. What about trying it out for yourself, before you display sceptiscism? :angry:

User avatar
justin
Senior Member
Senior Member
Posts: 1998
Joined: 08 Dec 2001 01:38
Location: CT, USA

Re: How: Enemies attack when attacked..?

Post by justin » 16 Sep 2009 17:48

Fluen is right :)
Dark Skies loom...
https://youtu.be/TScjB7EjBlI

User avatar
Howaito
Member
Member
Posts: 349
Joined: 14 Mar 2006 19:21
Location: Inglaterra

Re: How: Enemies attack when attacked..?

Post by Howaito » 18 Sep 2009 13:21

Woah! I never said I didn't believe you. I just thought you were referring to TR3's troops. Sorry for mis-understanding you. :-P
The Cartoon World Returns March MMX

User avatar
Fluen
Member
Member
Posts: 941
Joined: 01 Mar 2006 18:37
Location: Elsinore, Denmark

Re: How: Enemies attack when attacked..?

Post by Fluen » 18 Sep 2009 13:49

Ah! A misunderstanding. That's ok.

Yes, the slot TROOPS contains an Middle East looking soldier, who will just do his merry rounds, until Lara fires her guns and an enemy is near. She doesn't even have to fire at the enemy. The troops will right away pursue the enemy and fire at it.

I think Titak used the troops to set up an impressive firefight between to groups of soldiers in her original Himalayan Mysteries.

User avatar
Howaito
Member
Member
Posts: 349
Joined: 14 Mar 2006 19:21
Location: Inglaterra

Re: How: Enemies attack when attacked..?

Post by Howaito » 18 Sep 2009 14:57

Thank you, I'll use the troops slot then. It seems not to work with skeletons for some reason, maybe because they attack with swords instead of guns..? Doesn't matter, though! Thanks for the help. :)
The Cartoon World Returns March MMX

User avatar
Fluen
Member
Member
Posts: 941
Joined: 01 Mar 2006 18:37
Location: Elsinore, Denmark

Re: How: Enemies attack when attacked..?

Post by Fluen » 24 Sep 2009 12:31

If you want an enemy with a melee weapon, you may have to use the scorpion slot. Titak did that in Himylayan Mysteries 2 (she has been very creative). She placed an enemy of another kind in a room neither Lara nor the scorpions had access to. That way the scorpions were harmless to Lara. The warrior monks doing fighting stands in the monastery were actually scorpions.

Have a talk with her. She is much better informed about possibilities and limitations with this setup. Just be aware the character will be constantly aggressive, though not to Lara. Those monks ran around and yelled and swung their spears everywhere. And because the scorpion has both two claws and a poisonous tail, you must be very careful about which mesh and state-ID is used for what, or you will get an enemy, which crashes the game engine.

But if Lara fires at a scorpion, she's in deep trouble, even if there is another kind of enemy near.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests