Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Script to make more difficult to escape from monsters
Author  Uther1978
Submitted / Updated  08-01-2010 / 08-25-2010
Category  Creature AI
Expansions  Works on all versions
View Code  

Select All Text | View Code in separate window
Format  Code Only
Type  Type - Combat
Description
I have noticed that when the PC escapes from enemies following a straight line, the enemies with melee weapon can't hit him, even if they are more fast. This script, added to a heartbeat of a enemy, make him able to chase the pc.

Update 8/25/2010: I have changed the code. The script now dont affect the PC with penalties.

Files

NameTypeSizeDownloads
NO FILES
SCORE OUT OF 10
5.08
5 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (22):

Posted by ffbj at 2011-08-21 20:41:43    Voted 7.25 on 08/21/11
and... ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSpeed, OBJECT_SELF, 6.0);
if (GetIsEnemy (oPC) && (iHdd < 3))
{
ActionAttack(oPC);
}
else ActionMoveToLocation(GetAheadLocation(oPC), TRUE);
}


Posted by ffbj at 2011-08-21 20:40:22    Voted 7.25 on 08/21/11
That did not seem to get all the script:
ClearAllActions(TRUE);
if ((GetDistanceToObject(oPC) >= 3.0f) && (GetDistanceToObject(oPC)

Posted by ffbj at 2011-08-21 20:37:50    Voted 7.25 on 08/21/11
I made a few changes to the original script, with authors permission:
#include "x0_i0_position"

void main()

{

object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
int iHd = GetHitDice (oPC);
int iHd1 = GetHitDice (OBJECT_SELF);
int iHdd = iHd - iHd1;
effect eSpeed = EffectMovementSpeedIncrease(125);
//change number to change speed. added for possible temporary speed increase.


ClearAllActions(TRUE);
// you probably want to use the TRUE parameter here as this is likely to occur
// in combat otherwise the ClearAllActions call will have no effect.


if ((GetDistanceToObject(oPC) >= 3.0f) && (GetDistanceToObject(oPC)

Posted by ffbj at 2011-08-21 20:34:08    Voted 7.25 on 08/21/11
While the original script had problems I thought the idea had merit.

Posted by uther1978 at 2010-08-25 06:12:28    Voted 10.00 on 08/25/10
Update 8/25/2010: I have changed the code. The script now dont affect the PC with penalties, but only improves the A.I.

Posted by uther1978 at 2010-08-17 04:11:12    Voted 10.00 on 08/25/10
If someone has a good idea to fix npc A.I., please tell me.

Posted by ShaDoOoW at 2010-08-15 20:52:08    Voted 1.00 on 08/15/10
What Markshire and The_Krit said.
_________________________
[Boost System] [Door System] [Devastating Critical Immunity] [HIPS remake] [Circle Kick Mode] [1.69 Full 2da Source]

Posted by ffbj at 2010-08-14 08:13:07    Voted 7.25 on 08/21/11
I think it does slow the PC down even if immune like from Freedom of Movement. It's just an effect applied to the PC if their fatigue falls below a certain point. So my guess is it will work as will all the other effects as the PC becomes more fatigued. So even if immune to KD they will still fall down if they become exhausted.

Posted by uther1978 at 2010-08-07 09:02:34    Voted 10.00 on 08/25/10
The fatigue script works even with PC immune to speed reduction?

Posted by uther1978 at 2010-08-07 07:52:57    Voted 10.00 on 08/25/10
Thanks!

Posted by ffbj at 2010-08-07 07:27:57    Voted 7.25 on 08/21/11
I made something to emulate combat fatigue. It slows the player briefly with a winded condition first, makes it difficult to run away. To me this script is too specific and there is not enough value to warrant it's use, though I agree it is a bit odd that PC's can actually run from wolves for instance.

Posted by uther1978 at 2010-08-07 05:36:56    Voted 10.00 on 08/25/10
Ops, this is the new script:

#include "x0_i0_position"

void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);

ClearAllActions();

if (GetDistanceToObject(oPC) < 6.5f)

if (GetDistanceToObject(oPC) > 3.0f)
{
ActionMoveToLocation(GetOppositeLocation(oPC), TRUE);
}

ActionDoCommand(ActionAttack(oPC));

}

Posted by uther1978 at 2010-08-07 05:21:03    Voted 10.00 on 08/25/10
This seems working a little, but I must keep working on it....



#include "x0_i0_position"



void main()
{






object oNearestplayer = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);

if (GetDistanceToObject(oNearestplayer) < 6.0f)

{



object oTargetplayer;
oTargetplayer = oNearestplayer;




effect eEffect = EffectMovementSpeedDecrease(99);

eEffect = SupernaturalEffect(eEffect);

if (GetHasSpellEffect(EFFECT_TYPE_HASTE, oTargetplayer))

{





ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectSlow() , oTargetplayer, 6.0f);

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectACIncrease(4, AC_DODGE_BONUS) , oTargetplayer, 6.0f);




}


FloatingTextStringOnCreature("I am a target of a enemy, I can't run for 6 seconds", oTargetplayer);



ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTargetplayer, 6.0f);



DelayCommand(6.0f, FloatingTextStringOnCreature("I can run now", oTargetplayer));


}
}


Posted by uther1978 at 2010-08-07 03:48:55    Voted 10.00 on 08/25/10
Thx, I will try it.

Posted by The_Krit at 2010-08-06 15:23:30    
So you have not analyzed the problem to determine the root cause? That is often a good first move when trying to solve a problem. I believe the problem stems from the monster moving to *just* within melee range then starting its attack. But there is a delay between the start of the attack and the verification by the combat engine that the combatants are within melee range. In that small slice of time, the PC moves out of melee range, starting the cycle over.

Cancel the ActionAttack(), use ActionMoveToObject() to move to well within melee range, then re-initiate the attack with ActionDoCommand(ActionAttack()) -- you'll need this double call to make the new attack action wait its turn in the action queue.

Posted by uther1978 at 2010-08-05 14:20:32    Voted 10.00 on 08/25/10
Yes, I tried to fix the monster AI but I not found a solution. If someone has an idea can suggest here.

Posted by The_Krit at 2010-08-05 11:32:52    
Penalizing the player because of a bug in the monster is going about things backwards, isn't it? Why not fix the NPCs instead of arbitrarily crippling PCs?

Posted by uther1978 at 2010-08-04 09:24:09    Voted 10.00 on 08/25/10
Even with the Jasper AI the NPCS was unable to chase a PC that escapes following a straight line, even if the npc has the DM speed. This is very frustrating for me.
Mantain the chase or place obstacles is effectively a good solution.

Posted by Markshire at 2010-08-04 09:11:07    Voted 1.00 on 08/03/10
In PnP there's nothing in any of the rules that say a monster (or NPC) gets a "pause" or "slow" because the PC is getting away. What a monster gets when a PC is fleeing is an Attack of Opportunity. Same one NWN gives a monster when a PC flees. Now, in terms of game mechanics, I don't see the need to change anything. The creature AI built into the game by BW is sufficient to maintain the chase of the PC through multiple transitions and so on. So if the monster is determined enough to chase the PC they will continue to do so until the PC slows or runs the wrong direction. If the AI isn't up to your liking, track down any of the alternates or add-ons here on the vault and try them out. Jasperre's is a solid one. In the end, if the intent is to slow up the PC from running directly away from a monster, then place more obstacles for the PC to go around. That should be sufficient to slow them down enough to get "captured" or otherwise chewed upon.
_________________________
Vault Game World Entry: Markshire
Website: www.markshire.com
Server: www.markshire.net:5121
NWNWiki: Markshire
Vault Submissions:
NWN1: Magic Carpet Transitions | Experience and Teamwork System | Portable Persistent Chest System | Nerfed Pulse Drown | Renaming System | Quill of PC Recording
NWN2: Climbing System | Explosive Barrels | Quill of PC Recording
Fiction: A Missed Adventure | Kurm and the Sewer King's Curse | A Harrowing Story | Loki's Foulest Trick | Rising Force | The Mad Red Titan: One, Two, Three

Posted by uther1978 at 2010-08-03 12:09:10    Voted 10.00 on 08/25/10
Maybe to avoid the dexterity bug I can slow the PC instead of immobilize him.

Posted by Raven_Blood at 2010-08-03 11:22:09    Voted 7.00 on 08/03/10
I must say the idea is neat, but i must agree with Markshire on the topic.

I wont go so fat as to say it is mean, but having this intended for online use it out of the question lol

It would however go great for a true Hardcore D&D module story :] keep em up! id like to see more

Posted by Markshire at 2010-08-03 10:02:10    Voted 1.00 on 08/03/10
I'm thinking that this is totally unnecessary and likely to cause people to log out on the spot. As a player and a DM I have seen many PCs fail to escape monsters regardless of how they try to evade them. A "pause" where the PC is immobilized or their Dex drops to 3 is just mean really.
_________________________
Vault Game World Entry: Markshire
Website: www.markshire.com
Server: www.markshire.net:5121
NWNWiki: Markshire
Vault Submissions:
NWN1: Magic Carpet Transitions | Experience and Teamwork System | Portable Persistent Chest System | Nerfed Pulse Drown | Renaming System | Quill of PC Recording
NWN2: Climbing System | Explosive Barrels | Quill of PC Recording
Fiction: A Missed Adventure | Kurm and the Sewer King's Curse | A Harrowing Story | Loki's Foulest Trick | Rising Force | The Mad Red Titan: One, Two, Three

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Prefab Blueprints


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters