La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 28/04/2024 15:01:28


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
KaG
Légende vivante
Inscrit le: 30 Sep 2002
Messages: 445
Localisation: Rodez (12)
Répondre en citant
Posté le : 26/10/2002 18:58:08 Sujet du message : 1 maison 50 portes

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 Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur MSN Messenger Numéro ICQ Ignorer l'utilisateur
 
Baldurien
L'homme qui chutait sur le macadam
Inscrit le: 12 Sep 2002
Messages: 14064
Localisation: Quadran Alpha
Répondre en citant
Posté le : 26/10/2002 21:24:53 Sujet du message :

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 Biggrin
_________________
#nwnights-fr @ irc.darkmyst.org TitanQuest-FR
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
KaG
Légende vivante
Inscrit le: 30 Sep 2002
Messages: 445
Localisation: Rodez (12)
Répondre en citant
Posté le : 27/10/2002 16:02:56 Sujet du message : retrouvé

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 Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur MSN Messenger Numéro ICQ Ignorer l'utilisateur
 
Lavok
Légende vivante
Inscrit le: 22 Oct 2002
Messages: 434
Localisation: Sphère planaire
Répondre en citant
Posté le : 28/10/2002 09:27:25 Sujet du message : Problème ?

Mais alors, si on cambriole une de ces maisons, on a cambriolé toute la ville Very Happy Laughing !

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 Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Gorkk
Site Admin
Inscrit le: 12 Sep 2002
Messages: 1768
Localisation: Ici et ailleurs
Répondre en citant
Posté le : 28/10/2002 15:18:38 Sujet du message :

L'avantage c'est que ca t'économise pas mal de place là Smile (et oui c'est important les octets utilisés ou non Wink)
_________________
Sacred - FR - La Bibliothèque de Neverwinter - Titan Quest - FR Cool
Bloqué dans SoU ? La solution n'est pas loin...
HotU vous pose des problèmes ? Une seule solution Wink
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur MSN Messenger Numéro ICQ Ignorer l'utilisateur
 
Baldurien
L'homme qui chutait sur le macadam
Inscrit le: 12 Sep 2002
Messages: 14064
Localisation: Quadran Alpha
Répondre en citant
Posté le : 28/10/2002 17:35:19 Sujet du message :

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 Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
Montrer les messages depuis :
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


Sauter vers:
FAQ | Rechercher | Liste des Membres | Groupes d'utilisateurs | S'enregistrer | Profil | Se connecter pour vérifier ses messages privés | Connexion
Powered by phpBB 2.* [m] © 2001, 2002 phpBB Group
Theme rewritten in beautiful XHTML code by Baldurien.
Thème "La Bibliothèque de Neverwinter" crée par Kruger
Traduction par : phpBB-fr.com
Page generated in 23.348ms