Script issues for Modathon entry

Script issues for Modathon entry

Postby Drakkmore » Wed May 31, 2017 10:48 pm

Okay I've got this issue with the following door script:
Code: Select all
Begin Earthdoor

short haskey

If ( MenuMode == 0 )
   if ( OnActivate == 1 )
      if ( player->GetItemCount m_earthicefree == 0 )
         if ( haskey == 0 )         
               MessageBox "You do not have the item required to open this door."
         endif
      endif
   elseif ( player->GetItemCount m_earthicefree == 0 )
      if ( haskey == 1 )
         Activate
      endif
   else
      Activate
      set haskey to 1
   endif
endif


End Earthdoor

Everything works fine unless you try activating the door before grabbing the "key to the door.

Here is a short video to show exactly what is happening:
Since the youtube tags do not seem to be working here is the link instead: https://www.youtube.com/watch?v=5MtI-B2Fy5U

I'll continue looking at the script to see if I can get it sorted, but I'm running out of time to complete my demo, and I've still got a bunch of things to finish up on.

Edit: It should be noted that this script is an edited form of the Nuncius closet script from Bloodmoon.
User avatar
Drakkmore
 
Joined: Mon Apr 15, 2013 6:27 pm

Re: Script issues for Modathon entry

Postby Denina » Thu Jun 01, 2017 12:09 am

Okay, I'm no scripting genius or anything but after watching the video and looking at the script again, I'm wondering if the set haskey to 1 is the problem. Maybe it's looping something causing the door to act so goofy?

I have a mage door lock script that's set up very similar to what you have going on here and it works perfectly. Maybe that can help?

Code: Select all
Begin  ah_door

short DoOnce

if ( onactivate == 1 )
   if ( DoOnce == 0 )
      if ( player -> getitemcount "key_amayahome" )
         activate
         set DoOnce to 1
         return
      else
         messagebox "The door seems stuck. Your hand pulses with energy where it grips the door's handle."
         return
      endif
   elseif ( DoOnce == 1 )
      activate
   endif
endif

end


After that, the door always opens without the key so I'm not sure the set haskey to 1 line is necessary.
User avatar
Denina
Queen of Sarcasm
 
Joined: Mon Mar 04, 2013 10:57 pm
Location: Balmora, usually

Re: Script issues for Modathon entry

Postby Drakkmore » Thu Jun 01, 2017 1:00 am

Thank you Denina, I'll give it a try.

EDIT: It works like a dream Denina.
I posted the same query on GHF too, and Wolf also came up with a script that works slick as butter as well. Now I have the quandary of which script to use. Ima flip a coin, and you'll get to see which script one out when the mod is released.
User avatar
Drakkmore
 
Joined: Mon Apr 15, 2013 6:27 pm

Re: Script issues for Modathon entry

Postby Denina » Thu Jun 01, 2017 1:27 am

Use the one that works best for your mod's needs.

Glad I could help.
User avatar
Denina
Queen of Sarcasm
 
Joined: Mon Mar 04, 2013 10:57 pm
Location: Balmora, usually

Re: Script issues for Modathon entry

Postby Drakkmore » Thu Jun 01, 2017 2:29 am

That's the thing Denina, they both do as I want with the door. Nothing fancy, just keep the door locked until the correct item is obtained by the player.
User avatar
Drakkmore
 
Joined: Mon Apr 15, 2013 6:27 pm


Return to Morrowind Modding

Who is online

Users browsing this forum: No registered users and 2 guests

cron