
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.







La date/heure actuelle est 16/04/2025 14:46:55
La Bibliothèque de Neverwinter Nights Index du Forum »
La Bibliothèque Binaire du NWScript - Neverwinter Nights
Voir le sujet précédent ¤ Voir le sujet suivant | |
---|---|
Auteur | Message |
KaG Légende vivante ![]() Messages: 445 Localisation: Rodez (12) |
Hello ^^
Voilà, il y a quelques temps je suis "tombé" sur un script interessant mais que je ne retrouve plus... Le principe : en général en ville il y a des dizaines de maisons, mais on ne s'amuse pas à faire des dizaines d'intérieur. On ne fait que cveux qui nous interessent. Le principe du script était de créer un intérieur générique pour toutes ces maisons. Lorsqu'on passe par une des portes, on tombe toujours dans la même maison (où il n'y a rien à faire). Jusque là c'est facile. Par contre quand on ressort de la maison, on se retrouve bien à l'endroit d'où on est parti. Quelqu'un l'aurait il vu quelque part? D(avance merci |
Revenir en haut | ![]() ![]() ![]() ![]() ![]() ![]() |
Baldurien L'homme qui chutait sur le macadam ![]() Messages: 14070 Localisation: Quadran Alpha |
ah
c'est plus ou moins simple je t'explique un chti peu le technique 1. Il faut savoir de quelle porte tu viens : on appellera cette porte A : lorsque le joueur quittera la zone (OnExit) tu vas mettre stocker en mémoire une location (SetLocalLocation je crois) sur le dit joueur. Code : // Area.OnExit if ( GetIsPc( GetExitingObject() ) ) { SetLocalLocation( GetExitingObject(), "LOCAL_LOCATION", GetLocation( GetExitingObject() ); } 2. Maintenant dans ta maison : tu vas prendre ta porte, et tu vas mettre un script dans l'événement OnAreaTransitionClick. Code : // Door.OnAreaTransitionClick if ( GetIsPc( GetLastOpenedBy() ) { AssignCommand( GetLastOpenedBy(), JumpToLocation( GetLocalLocation( GetLastOpenedBy(), "LOCAL_LOCATION" ) ); // on ferme la porte ActionCloseDoor( OBJECT_SELF ); } Bon ensuite, quelques problèmes dans mon script 1. on prend la créature qui "s'échappe" de la zone courante 2. on prend la créature qui a ouvert la porte, MAIS si ce n'est pas la bonne créature qu'on a pris, alors le script part à vau l'eau. 3. franchement, je te conseille de retrouver ton script ![]() _________________ #nwnights-fr @ irc.darkmyst.org TitanQuest-FR |
Revenir en haut | ![]() ![]() ![]() ![]() |
KaG Légende vivante ![]() Messages: 445 Localisation: Rodez (12) |
Pour ceusses que ça interesse :
Citation : -----------------
SmartDoor smart door.nss return.nss oexit_smart door.nss By Zandramus SmartDoor system is complete , this works for multiple doors leading to one room. it will lock the entry of a different door from a pc trying to enter from somewhere else. Ie two pc's cannot enter the same room from 2 different doors. However everyone can enter the area from the same door. Basically it allows you to have generic area's that many doors link to instead of having to have 1 area for each door. simply name the area's and doors correctly and it works like a charm if the area is empty it can again be entered from any door assigned to it. if it is occupied the pc attempting to enter from a different door gets the message an unknown force keeps you from entering. it is simple and works very well. it consists of 3 scripts smartdoor.nss the main script return.nss the script that returns the pc to where they left from oexit_smartdoor.nss the script that checks if the area is now empty and disassociates the last door from it. NWScript: //:://///////////////////////////////////////////// //:: Name Smart Door System //:: FileName smartdoor.nss //::////////////////////////////////////////////// /* Place this script in the door in your area leading to a shared room. name this door the same name as the target room you are going to place a waypoint inside the room you are going to with a tag of DST_areaname Ie. if your are going to an area named Appartment you need to do the following 1. create an area Named Appartment with a tag of Appartment. 2. create a waypoint inside that area with a tag of DST_Appartment facing the way you want the character to enter. 3. create a door with the Tag of Appartment in your area, you can have as many of these as you want each one will lead to the area Appartment. Click the door's area transition tab and select waypoint but leave the destination field blank. In the doors OnAreaTransitionClicked script Place this script. 4. create an exit door in the appartment area it doesnt matter what the tag or name of this door is, but click the doors area transition tag and select waypoint and leave the destination field blank. In the doors OnAreaTransitionClicked script Place the return script. 5. In the Area Appartment Place in the OnExit event the script oexit_smartdoor you should now have an area with a tag of Appartment a main area you are going from a door in the main area with a tag of Appartment a door in the Appartment area a waypoint in the Appartment area named DST_Appartment. both doors area transitions set to waypoint with the destination blank. all the scripts in their proper locations. */ //::////////////////////////////////////////////// //:: Created By: Zandramus //:: Created On: 07.23.2002 //::////////////////////////////////////////////// void main() { object oidUser; object oidDest; string sTag = GetTag(OBJECT_SELF); string sDest; location dLocation; SetLocalString(OBJECT_SELF, "Destination" , "DST_"+sTag ); sDest = GetLocalString( OBJECT_SELF, "Destination" ); oidUser = GetLastUsedBy(); SetLocalLocation(oidUser,"IWASHERE",GetLocation(oidUser)); oidDest = GetWaypointByTag(sDest); dLocation = GetLocation(OBJECT_SELF); // we need to find out if area is locked if (GetLocalInt(GetModule(),sDest) == 0) // Room is Unused { SetLocalLocation(GetModule(),sTag,dLocation); SetLocalInt(GetModule(),sDest, 1); AssignCommand(oidUser,JumpToObject(oidDest,FALSE)); } else { if (GetLocalLocation(GetModule(),sTag)== dLocation) // Room is Being Used By this Door { AssignCommand(oidUser,JumpToObject(oidDest,FALSE)); } else { SendMessageToPC(oidUser,"An Unknown Force Prevents you from entering");// Room is Being Used By another door } } } //:://///////////////////////////////////////////// //:: Name Smart Door Return //:: FileName return.nss //::////////////////////////////////////////////// /* Place this script in your interior exit door's ontransitionclicked event. This will check the last location of the pc and return him there. */ //::////////////////////////////////////////////// //:: Created By: Zandramus //:: Created On: 07.23.2002 //::////////////////////////////////////////////// void main() { object oidUser; object oidDest; string sDest; oidUser = GetLastUsedBy(); AssignCommand(oidUser,JumpToLocation(GetLocalLocation(oidUser,"IWASHERE"))); } //:://///////////////////////////////////////////// //:: Name On Exit Smartdoor //:: FileName oexit_smartdoor.nss //::////////////////////////////////////////////// /* Place this in the on exit event of your fluff area's it will pull the global variable name from the tag of that area so your area tag must match your door name this should be obvious by now. */ //::////////////////////////////////////////////// //:: Created By: Zandramus //:: Created On: 07.23.2002 //::////////////////////////////////////////////// void main() { string sTag = GetTag(OBJECT_SELF); string sDest; SetLocalString(OBJECT_SELF, "Destination" , "DST_"+sTag ); sDest = GetLocalString( OBJECT_SELF, "Destination" ); if(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,OBJECT_SELF,1) == OBJECT_INVALID) { SetLocalInt(GetModule(),sDest, 0); // area is empty unlock it } } |
Revenir en haut | ![]() ![]() ![]() ![]() ![]() ![]() |
Lavok Légende vivante Messages: 434 Localisation: Sphère planaire |
Mais alors, si on cambriole une de ces maisons, on a cambriolé toute la ville
![]() ![]() De toutes façons, ça prend 1 minute grand maximum de faire une zone de 2 sur 2 donc pour 30 maisons, ça ne fait jamais qu'une demi-heure... _________________ ToB : Une seule chose semble certaine : tant que le trône de sang de Bhaal restera vide, le chaos règnera. Moi : Une seule chose semble certaine : tant que la tête de singe de Bush restera vide, le chaos règnera. |
Revenir en haut | ![]() ![]() ![]() |
Gorkk Site Admin ![]() Messages: 1768 Localisation: Ici et ailleurs |
L'avantage c'est que ca t'économise pas mal de place là
![]() ![]() _________________ Sacred - FR - La Bibliothèque de Neverwinter - Titan Quest - FR ![]() Bloqué dans SoU ? La solution n'est pas loin... HotU vous pose des problèmes ? Une seule solution ![]() |
Revenir en haut | ![]() ![]() ![]() ![]() ![]() ![]() |
Baldurien L'homme qui chutait sur le macadam ![]() Messages: 14070 Localisation: Quadran Alpha |
Vu ce que tu utilise...
franchement hein paske là tu prends un script mais mettons que tu veux ajouter du people zou tu te tape tous les scripts CreateObject, etc 1. ça bouffe aussi de la mémoire 2. ça bouffe aussi de l'uc and co je pense pas que ce soit mieux _________________ #nwnights-fr @ irc.darkmyst.org TitanQuest-FR |
Revenir en haut | ![]() ![]() ![]() ![]() |


Page 1 sur 1 ¤
Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum