Jump to content

Recommended Posts

Posted (edited)

Hey everyone. I was hoping someone out there could help me figure out what's wrong with this script.

 

 

Begin 1Dum_ScryDetect

 

short OnPCDrop

short DoOnce

 

if ( GetPCCell "Sadrith Mora, Telvanni Council House" == 1 )

 

if ( GetPCCell "Sadrith Mora Tevlanni Council House, Entry" == 0 )

 

if ( GetDetected Player == 0 )

 

if ( OnPCDrop == 1 )

 

if ( DoOnce == 0 )

 

Journal "1Dum_lil_Telvanni" 10

 

set DoOnce to 1

 

endif

 

endif

 

endif

 

endif

 

endif

 

end

 

(Sorry for the crappy formatting. It wouldn't let me paste the script here so I just typed it in by hand.)

 

Anyhow, the script works mostly. The issue I'm having is that the player doesn't have to be undetected and drop the required item at the same time. They can drop the item, wait ten minutes. Hide. And get the journal entry regardless.

 

Any ideas on how to fix this?

Edited by ManiumX
Posted

Once OnPCDrop is true it continues to be true until it is manually reset to zero (false). That you should do as soon as it is true. Also, GetDetected is a fairly resource-hungry function. I suggest you move it inside the OnPCDrop block since it hardly matters if the player is seen if he/she is not dropping the item. Also, a quick return after the journal is set would be welcome. Something like this might work:

Begin 1Dum_ScryDetect
 
short OnPCDrop
short doOnce
 
if ( doOnce == 1 )
    return
elseif ( menumode == 1 )
    return
endif
 
if ( ( GetPCCell "Sadrith Mora, Telvanni Council House" ) == 1 )
    if ( ( GetPCCell "Sadrith Mora Tevlanni Council House, Entry" ) == 0 )
        if ( OnPCDrop == 1 )
            set OnPCDrop to 0
            if ( ( GetDetected Player ) == 0 )
                Journal "1Dum_lil_Telvanni" 10
                set doOnce to 1
            endif
        endif
    endif
endif
 
End
Posted

Thank you so much. Once I pulled out the redundant ( and corrected the spelling your version of the script worked perfectly! And I know how to avoid such things in the future.

  • 3 weeks later...
Posted

Really? Weird, I didn't notice an increase in crashing. Even so I'll look at changing them. I just did it that way so I wouldn't have to do so much scrolling while testing and editing.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...