Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / How to prevent enemies to attack through walls

Author
Message
The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 6th Jul 2010 03:48 Edited at: 6th Jul 2010 03:52
While working on a reliable tracking AI script I realized that the enemies stop attacking through walls if the lines including the plraddhealth action are modified by adding the plrcanbeseen condition.

just like this:

This is a line of stevepaul's medieval swordattack script, the plrdistwithin=94 is rather large so not even the thickest walls or doorframes prevent the attack. bond1's Zombies p.e. have only plrdistwithin=70 so the problem isn't that big there.

I am sure a lot of people know about this, but since I roam the boards daily and didn't know myself, I thought I'd risk posting it

EDIT: It doesn't prevent attacks through doors or other dynamic entities though.

In case you find my grammar and spelling weird ---> native German speaker ^^
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Jul 2010 05:05
Perhaps you can experiment with the Raycast condition to determine if a door is in the way. I can't recall exactly if the command effects dynamic objects (such as doors) but it's worth a try. If they attack you through doors, there seems little point in closing doors behind you.


The one and only,


The Storyteller 01
15
Years of Service
User Offline
Joined: 11th May 2009
Location: On a silent hill in dead space
Posted: 6th Jul 2010 11:22 Edited at: 6th Jul 2010 11:33
At least enemies don't move through dynamic doors so closing them is still usefull (unless the enemies have more brain than a zombie and ought to open doors ) but it seems, that the engine regards dynamic objects as *seetrough*. That's probably why adding plrcanbeseen doesn't change a thing.

I experimented with raycast in combination with rotatetoplr,strafe=x or rotatetoplr,rotatey=x to get enemies *unstuck* at corners, doorframes or obstacles but since I can't teach the AI to move into the *right* direction, I have to randomize it, which only creates random movement with the *chance* of overcoming the obstacle. My best bet is still followplr but the engine isn't too eager accepting ifplrtrail=1 even if the player passed by the enemy NPC...

In case you find my grammar and spelling weird ---> native German speaker ^^
Nbt
15
Years of Service
User Offline
Joined: 11th Oct 2009
Location: Behind you!!
Posted: 7th Jul 2010 17:59
To be honest I have played tons of so called AAA titles and even they still suffer a little attack through walls. This has come in a handy a few times by blowing them up with a nade through a wall

Your signature has been erased by a mod. The sig needs to be 600 width maximum (x 120 height) for all of it.

Login to post a reply

Server time is: 2024-11-24 21:50:32
Your offset time is: 2024-11-24 21:50:32