Porte dissimulé...

Répondre
Partager Rechercher
Voici le script de Bioware pour les porte dissimulé, mai il y a des point qui m'échappe ;....
Dans le script qui suis, peut'on indiquer la zone de destination ?
je pensai à cette ligne : SetLocalString( oidDoor, "Destination" , "DST_"+sTag ); mai je ne sai pas vraiment ?
C'est a dire que quand on clique sur la porte dissimulé on aille directement a un autre point.

Code PHP:

//::///////////////////////////////////////////////
//:: nw_o2_dtwalldoor.nss
//:: Copyright (c) 2001-2 Bioware Corp.
//:://////////////////////////////////////////////
/*
    This script runs on either the Hidden Trap Door
    or Hidden Wall Door Trigger invisible objects.
    This script will do a check and see
    if any PC comes within a radius of this Trigger.

    If the PC has the search skill or is an Elf then
    a search check will be made.

    It will create a Trap or Wall door that will have
    its Destination set to a waypoint that has
    a tag of DST_<tag of this object>

    The radius is determined by the Reflex saving
    throw of the invisible object

    The DC of the search stored by the Willpower
    saving throw.

*/
//:://////////////////////////////////////////////
//:: Created By  : Robert Babiak
//:: Created On  : June 25, 2002
//::---------------------------------------------
//:: Modifyed By : Robert, Andrew, Derek
//:: Modifyed On : July - September
//:://////////////////////////////////////////////

void main()
{
    
// get the radius and DC of the secret door.
    
float fSearchDist IntToFloat(GetReflexSavingThrow(OBJECT_SELF));
    
int nDiffaculty GetWillSavingThrow(OBJECT_SELF);

    
// what is the tag of this object used in setting the destination
    
string sTag GetTag(OBJECT_SELF);

    
// has it been found?
    
int nDone GetLocalInt(OBJECT_SELF,"D_"+sTag);
    
int nReset GetLocalInt(OBJECT_SELF,"Reset");

    
// ok reset the door is destroyed, and the done and reset flas are made 0 again
    
if (nReset == 1)
    {
        
nDone 0;
        
nReset 0;

        
SetLocalInt(OBJECT_SELF,"D_"+sTag,nDone);
        
SetLocalInt(OBJECT_SELF,"Reset",nReset);

        
object oidDoorGetLocalObject(OBJECT_SELF,"Door");
        if (
oidDoor != OBJECT_INVALID)
        {
            
SetPlotFlag(oidDoor,0);
            
DestroyObject(oidDoor,GetLocalFloat(OBJECT_SELF,"ResetDelay"));
        }

    }


    
int nBestSkill = -50;
    
object oidBestSearcher OBJECT_INVALID;
    
int nCount 1;

    
// Find the best searcher within the search radius.
    
object oidNearestCreature GetNearestCreature(CREATURE_TYPE_PLAYER_CHARPLAYER_CHAR_IS_PC);
    
int nDoneSearch 0;
    
int nFoundPCs 0;

    while ((
nDone == 0) &&
           (
nDoneSearch == 0) &&
           (
oidNearestCreature != OBJECT_INVALID)
          )
    {
        
// what is the distance of the PC to the door location
        
float fDist GetDistanceBetween(OBJECT_SELF,oidNearestCreature);

        if (
fDist <= fSearchDist)
        {
            
int nSkill GetSkillRank(SKILL_SEARCH,oidNearestCreature);

            if (
nSkill nBestSkill)
            {
                
nBestSkill nSkill;
                
oidBestSearcher oidNearestCreature;
            }
            
nFoundPCs nFoundPCs +1;
        }
        else
        {
            
// If there is no one in the search radius, don't continue to search
            // for the best skill.
            
nDoneSearch 1;
        }
        
nCount nCount +1;
        
oidNearestCreature GetNearestCreature(CREATURE_TYPE_PLAYER_CHARPLAYER_CHAR_IS_PCOBJECT_SELF ,nCount);
    }

    if ((
nDone == 0) &&
        (
nFoundPCs != 0) &&
        (
GetIsObjectValid(oidBestSearcher))
       )
    {
       
int nMod d20();

            
// did we find it.
       
if ((nBestSkill +nMod nDiffaculty))
       {
            
location locLoc GetLocation (OBJECT_SELF);
            
object oidDoor;
            
// yes we found it, now create the appropriate door
            
oidDoor CreateObject(OBJECT_TYPE_PLACEABLE,"Portedissimul",locLoc,TRUE);

            
SetLocalStringoidDoor"Destination" "DST_"+sTag );
            
// make this door as found.
            
SetLocalInt(OBJECT_SELF,"D_"+sTag,1);
            
SetPlotFlag(oidDoor,1);
            
SetLocalObject(OBJECT_SELF,"Door",oidDoor);

       } 
// if skill search found
    
// if Object is valid

d'une part je ne suis pas sur que ce script soit autosufisant (en fait je suis même sur qu'il ne l'est pas )
SetLocalString( oidDoor, "Destination" , "DST_"+sTag );
// make this door as found.
SetLocalInt(OBJECT_SELF,"D_"+sTag,1);
SetPlotFlag(oidDoor,1);
SetLocalObject(OBJECT_SELF,"Door",oidDoor);
toutes les variables enregistrées ici ne sont pas réutilisée.

Donc, il semble asset évident que le Destination et D_ représente le chemin cible.

Mais le plus simple est peut être de mettre (modifier) le script dans le OnUsed de ta porte, genre :
Code PHP:

void main()
{
    
AssignCommand(GetLastUsedBy(), ActionJumpToObject(GetObjectByTag("TAG_DE_TA_CIBLE")));

C'est ce que j'ai fait, mai le problème est que je dois a chaque fois créer un nouveaux script et une nouvelle porte pour chaque porte dissimulé... Donc c pas terrible, c'ets pour ca que si il est possible de mettre la destination directement sur le script du déclencheur ca serai bien mieux.
sisi, y doit y avoir moyen

je suppose que si tu remplace a la fin de ton script :

Code PHP:


            
// did we find it.
       
if ((nBestSkill +nMod nDiffaculty))
       {
            
sTag "TAG_DE_LA_DESTINATION" //ICI LE CHANGEMENT !!!!
            
location locLoc GetLocation (OBJECT_SELF);
            
object oidDoor;
            
// yes we found it, now create the appropriate door
            
oidDoor CreateObject(OBJECT_TYPE_PLACEABLE,"Portedissimul",locLoc,TRUE);

            
SetLocalStringoidDoor"Destination" "DST_"+sTag );
            
// make this door as found.
            
SetLocalInt(OBJECT_SELF,"D_"+sTag,1);
            
SetPlotFlag(oidDoor,1);
            
SetLocalObject(OBJECT_SELF,"Door",oidDoor);

       } 
// if skill search found
    
// if Object is valid 
mais je garentie rien, j'ai pas cherché a comprendre l'intégralité du code et j'ai pas vu le code dans le OnUsed
vi j'ai oublié un ; derrière la ligne que j'ai ajouté.

sTag = "TAG_DE_LA_DESTINATION"; //ICI LE CHANGEMENT !!!!

ca devrait aller mieux comme ca
Rholala, j'te jure, ces jeunes
Je vous copie-colle texto les commentaires de Bioware sur l'objet "Déclencheur de porte murale dissimulée".

Citation :
Hidden Wall Door Trigger

Make a waypoint that has a tag of DST_<tag of this trigger> and when the user opens and uses the door they will be moved to that location.

The reflex save is the distance in meters that the player can find the hidden door.

The willpower save is the DC of finding this door.
En clair, vous donnez un tag au déclencheur, et vous créez un waypoint de destination qui portera le tag : DST_<tag du déclencheur>.

Je vous assure que ça marche
Nickel, ca marche nickel !!!
Bon, passons à la phase suivante.....
Comment pui je faire pour augmenté la difficulté de trouver la porte, parce que la meme si il est pas a coté le pj trouve facilement la porte... !! là c apparament un jet de d20, mai je ne sai pas si il le fai plusieur fois ou simplement une seul fois..
C'est comme le Port-Salut

Code PHP:

The radius is determined by the Reflex saving throw of the invisible object
    The DC of the search stored by the Willpower saving 
throw. 
Tu augmentes, ou diminues, le jet de Reflex de ta porte pour la distance de détection, et le jet de vigueur pour la difficulté.

En plus....
Code PHP:

    // get the radius and DC of the secret door.
    
float fSearchDist IntToFloat(GetReflexSavingThrow(OBJECT_SELF));
    
int nDiffaculty GetWillSavingThrow(OBJECT_SELF); 
PS: diffaculty ? Sont fort pour inventer de nouveaux mot chez Bioware
Dans les propriétés (premier onglet), tu peux régler :
- le jet de réflexe : correspond à la distance maximale à partir de laquelle le PJ peut détecter la porte
- le jet de volonté (willpower) : correspond au DD pour trouver la porte dissimulée; la porte est détectée si on a : compétence du PJ + d20 >= DD, et le jet est refait chaque round je crois.
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés