Bienvenue sur JeuxOnLine - MMO, MMORPG et MOBA !
Les sites de JeuxOnLine...
 

Panneau de contrôle

Recherche | Retour aux forums

JOL Archives

[Editeur NWN] les WayPoints

Par Daynos le 19/5/2002 à 16:30:33 (#1489580)

Apparemment, pour les way points, il en existe plusieurs type.

Post Point

Le "post" semble être le plus simple :


This waypoint may be used to have a guard stand where it has been placed.
1. Create a guard and either use the existing Tag or fill in a new one.
2. Place this Waypoint with the Tag "POST_" + the NPC Tag.
3. Place or make sure that WalkWayPoints() is within the On Spawn script for the NPC and after combat, the NPC shall return to it's "POST".


Donc sous réserve d'avoir bien compris :
1 > créer un PNJ. Dans les propriété du PNJ créé, repérer son nom "tag". Par exemple "NW_AIR" par défaut pour un élémental d'air
Tag étant l'identifiant de l'Objet "pnj" et non le nom affiché du PNJ... C'est donc ce Tag qui est utilisé par un script pour identifier un PNJ (ou de mnuère générale tout objet, créature, élméent de décors etc.). Chaque objet possède son tag. Je ne sais pas encore si l'on peut donner à plusieurs objet le même tag (en théorie, c'est quand même un truc à éviter).

2 > Placer un way point de type "post". Nommer le "tag" de ce way point "POST_" + nom du tag du PNJ auquel il s'applique. Donc si j'ai bien compris : "POST_NW_AIR" pour mon élémental.

3 > S'assurer que dans le script de l'événement "OnSpawn" du PNJ, on trouve la fonction "WalkWayPoints()". Ainsi le PNJ en apparaissant sur la zone ira jusqu'au way point et s'y mettra en poste. Apparemment c'est automatique. S'il ne trouve pas de Way point à son nom, je suppose que le PNJ reste là où il apparaît.
Le sens du Way point doit probablement déterminer là où le PJN regardera par défaut.

WalkWayPoints() est une fonction incluse par défaut semble-t-il...


//::///////////////////////////////////////////////
//:: Default: On Spawn In
//:: NW_C2_DEFAULT9
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Determines the course of action to be taken
after having just been spawned in
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_O2_CONINCLUDE"
#include "NW_I0_GENERIC"

void main()
{
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
//SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
//SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
// This causes the creature to say a special greeting in their conversation file
// upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
// greeting in order to designate it. As the creature is actually saying this to
// himself, don't attach any player responses to the greeting.

//SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
// This will set the listening pattern on the NPC to attack when allies call
//SetSpawnInCondition(NW_FLAG_STEALTH);
// If the NPC has stealth and they are a rogue go into stealth mode
//SetSpawnInCondition(NW_FLAG_SEARCH);
// If the NPC has Search go into Search Mode
//SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
// This will set the NPC to give a warning to non-enemies before attacking

//SetSpawnInCondition(NW_FLAG_SLEEP);
//Creatures that spawn in during the night will be asleep.
//SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.

// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
//SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
//SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);// OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
//SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)

// CUSTOM USER DEFINED EVENTS
/*
The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the
On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined
events user 1000 - 1010
*/
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
//SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
//SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
//SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);//OPTIONAL BEHAVIOR - Fire User Defined Event 1006
//SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
//SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
//SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007

// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) *****************************************************************************************
SetListeningPatterns();
// Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints();
// Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
GenerateNPCTreasure();
//* Use this to create a small amount of treasure on the creature
}



Waypoints

This is the default waypoint you may place to set a patrol path for a creature or NPC.
1. Create the creature and either use its current Tag or fill in a new one.
2. Place or make sure the WalkWayPoints() is within the body of the On Spawn script for the creature.
3. Place a series of waypoints along the route you wish the creature to walk.
4. Select all of the newly created waypoints and right click. Choose the Create Set option.
5. The waypoint set will have a set name of "WP_" + NPC Tag. Thus if an NPC with the Tag "Guard" will have a waypoint set called "WP_Guard". Note that Tags are case sensitive.


Alors les waypoints, c'est pas beaucoup plus compliqué, il n'y a qu'à lire les commentaires...

1. Créer une créature et utilisez soit son Tag actuel soit un Tag de votre choix.
2. Vérifiez que dans le script présent sur l'évènement "On Spawn", on trouve la fonction "WalkWayPoints()".
3. Placez une séries de Waypoints le long de la route que votre créature doit parcourir.
4. Sélectionnez tous les "Way Points" que vous venez de créer pour cette créature, et faite un click droit. Choisissez l'option "Create Set".
5. Donnez à votre set le nom "WP_" + de Tag de votre créature. Donc si le Tag votre créature est "Garde", le "waypoint set" doit s'apeller "WP_Garde". Notez que les Tag sont sensibles à la casse.


Chaque Way point se voit alors attribué un Tag numéroté :
WP_Garde_01
WP_Garde_02
WP_Garde_03
etc.

Je suppose que ces numéros déterminent l'ordre de parcours. Mais il faudra tester pour s'en assurer.

JOL Archives 1.0.1
@ JOL / JeuxOnLine