I am building a sp module and I have some guards that I have a tiny little script into their onpercieve events that works fine as it is. What it does is to make the guard turn around and face the pc, then say a one-liner. What I would like the script to be able to do is when the PC is no longer detected by the guard, for the guard to resume their original facing. The problem is that according to the lexicon the built in function GetLastPerceptionVanished(), only works when the PC leaves the game. Any suggestions please?
TR
Silly little facing problem
Débuté par
Tarot Redhand
, avril 02 2013 01:07
#1
Posté 02 avril 2013 - 01:07
#2
Posté 02 avril 2013 - 02:39
You can't rely on an event for vanished so maybe a userdef heartbeat handler, with something like this in it:
Or some such...
Cheers,
meaglyn
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_PC, OBJECT_SELF,CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, 1);
if(!GetIsObjectValid(oPC)) {
// do the return facing
}
Or some such...
Cheers,
meaglyn
#3
Posté 02 avril 2013 - 04:36
Throw down an event (AoE) for them to respond to.
#4
Posté 02 avril 2013 - 10:58
Having now tested GetLastPerceptionVanished(), I can say with some certainty that the lexicon got this one wrong. It actually works when the NPC can no longer detect the PC in sp mods. It doesn't mean that I have a perfectly working script, but I have a sneaky idea of a way around that problem that is more roleplay anyway. Thanks for the suggestions guys. Well, I have learned not to take *everything* that the lexicon says as gospel only 99.9%
.
TR
TR
Modifié par Tarot Redhand, 02 avril 2013 - 10:59 .
#5
Posté 08 avril 2013 - 06:26
Can also do with a waypoint variable.
create waypoint for guard then in varaibles WAYPOINT_SETFACING_L int 1
create waypoint for guard then in varaibles WAYPOINT_SETFACING_L int 1
#6
Posté 09 avril 2013 - 12:22
Found another error with the downloadable version of the lexicon. The numbers that it claims match NwNs built-in constants for animations are wrong. This is only of consequence if you are using something like Axe Murderer's Killer Walk Waypoints, where you need the actual numbers. If you are coding in the script editor, use the constant names and you'll be fine. Also, the numbers in the readme that comes with KWW are correct, its just those in the downloadable lexicon.
TR
TR
Modifié par Tarot Redhand, 09 avril 2013 - 12:23 .
#7
Posté 09 avril 2013 - 01:21
Tarot Redhand wrote...
Well, I have learned not to take *everything* that the lexicon says as gospel only 99.9%.
TR
There is a large volume of core functions with inaccuracies here and there. The most developed articles tend to be the cleanest, but I have found quite a few with errors especially amongst the lesser used functions.





Retour en haut






