Jump to content

Missing EOF at "if"


GrantHobar

Recommended Posts

Trying to make a door script that auto locks itself but keep getting this error and don't know what to do..

 

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Autolock.psc(7,8 ): missing EOF at 'if'

 

scriptname myDoorLockScript

float timer
short doWhat

Begin GameMode
       if ( getlocked )
       else
               if timer > 0
                       set timer to timer - getsecondspassed
               else
                       if doWhat == 0
                               set timer to timer + 1
                               set doWhat to 1
                               return
                       elseif doWhat == 1
                               lock 100
                               set doWhat to 0
                               return
                       endif
               endif
       endif
End

Edited by GrantHobar
Link to comment
Share on other sites

Trying to make a door script that auto locks itself but keep getting this error and don't know what to do..

 

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\Autolock.psc(7,8 ): missing EOF at 'if'

 

scriptname myDoorLockScript

float timer
short doWhat

Begin GameMode
       if ( getlocked )
       else
               if timer > 0
                       set timer to timer - getsecondspassed
               else
                       if doWhat == 0
                               set timer to timer + 1
                               set doWhat to 1
                               return
                       elseif doWhat == 1
                               lock 100
                               set doWhat to 0
                               return
                       endif
               endif
       endif
End

if getlocked do "what?" ... something needs to happen there, even if is just "return"

 

PS: The logic is confuse too but I have not dabbed with Papyrus enough to dare to comment about it. As it is there, the variable timer has no purpose (better if testing it to less or equal 0).

You need to make it a "property" if is to be used outside the script.

 

Finally this kind of logic is better treated as "event".

Edited by nosisab
Link to comment
Share on other sites

What do you suggest I put there? Fairly new to scripting and thought this would work as is..

I'm not papyrus expert, but as put in the PS... better treating the logic as event... OnActivate.

 

The Problem is I'm not sure about what you want to do (of course is to lock something), but how, why and when you want the object to be locked?

Edited by nosisab
Link to comment
Share on other sites

What do you suggest I put there? Fairly new to scripting and thought this would work as is..

 

Maybe a message?

and does getlocked return true?...not sure about that one edit: just checked, yes it does

 

if ( getlocked )

Debug.MessageBox("It's locked.")

else

Edited by DizzasterJuice
Link to comment
Share on other sites

What do you suggest I put there? Fairly new to scripting and thought this would work as is..

 

Maybe a message?

and does getlocked return true?...not sure about that one -- if (getlocked.GetValue()>0)

 

if ( getlocked )

Debug.MessageBox("It's locked.")

else

 

I tried adding that message and it gave me the same problem I originally had with the missing EOF

Link to comment
Share on other sites

Trying to make a door lock automatically after 1 second. So like you open the door with a key and then 1 second later it locks itself with the key lock again.

ahh, that can be done in its own activation function, I remember have seen something in that line before. Remember Papyrus is way more powerful than previous TES script languages, better learning it's new resources instead trying to reuse the old concepts.

 

Use the Script reference sublink there

Edited by nosisab
Link to comment
Share on other sites

Try IsLocked with your door property instead of GetLocked by itself. I'm assuming you know how to create quest properties.

if (DoorProperty.IsLocked())

Debug.MessageBox("It's Locked.")

else

 

http://www.creationkit.com/Bethesda_Tutorial_Basic_Quest_Scripting#Properties

Edited by DizzasterJuice
Link to comment
Share on other sites

  • Recently Browsing   0 members

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