Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a "harvest" container
04-16-2009, 10:39 PM,
#1
Making a "harvest" container
I thought I'd try my hand at making a "Harvest" container, i.e. a container that opens to show it's empty after the player has emptied its inventory. I've borrowed inspiration from that mod before when I made plants whose ingredients on the plant itself became hidden after the player picked it.

[youtube=center]http://www.youtube.com/v/SscYCXwHYK4[/youtube]

I picked that model to do it on because I had already made it to be opened. Originally the doors were supposed to be real doors that the player could open, but it never worked and was overly complicated anyways; who'd really want to set up four doors just to have a closet container? So I turned it into a single, static model but kept the inside visible. Now that I know a bit about animation I thought I'd once again realize the idea I had way back when I made it.

Animating the model isn't a problem. The script for it on the other hand... for inspiration I looked at the model xmsharvestlowerdrawers01hifi.nif from the "Harvest [Containers]" mod. I've attached an archive that has a copy of the nif + the script it uses.

As you can tell by looking at the script, it's kinda complicated. Without that much knowledge about scripting in general or this script in particular, I think I would like to omit the parts about "stagger" and "fast". "stagger" seems to be an option for low-end users, which I don't think is necessary in our case. "fast" seems to be an alternative open animation that plays randomly, though that's just a guess on my part. Kinda seems like overkill in this case. I also think a lot of the long portion about player faction is unnecessary in our case because our containers won't occur in interiors belonging to those factions. I mean we have Mages Guild, Fighters Guild and so on but not Oblivion-specific guilds like the Blackwood Company.

Though just by looking at the script there seems to be a lot of failsafes in it that gives it a solid impression (in my humble opinion).
¤ How to add images or files to your post ¤ Silgrad's UBBCode
My pet peeve: huge images in img code. I reserve the right to make any such image into a clickeable thumbnail whenever I see it.
Angel mired in filth
[Image: SignatureBannerRazorwing.jpg]
Reply
04-16-2009, 11:24 PM,
#2
 
You are correct, a lot of failsafes and for this mod a lot of unnecessary faction checks.

Though it should be easy to cut out all the "crap" thats not needed and just use what is needed. Though I have not used this before, so I would need to check it out in-game.

Seems rather complicated for playing some animations :yes:
[color="#9ACD32"]How do you Skyrim? Show Us in TES Alliance's [url="http://tesalliance.org/forums/index.php?/forum/112-official-skyrim-contest/"]Salute to Skyrim Contest[/url]![/color]
Reply
04-17-2009, 04:50 PM,
#3
RE: Making a "harvest" container
Quote:Originally posted by Razorwing
I thought I'd try my hand at making a "Harvest" container, i.e. a container that opens to show it's empty after the player has emptied its inventory.
That's a nice feature and the anim looks great! Smile

I agree, a simple script would suffice (checking if the container has been emptied and play the forward/backward anim).
Dum loquor, hora fugit  - While I speak the time flies



Ovid 43 BC - 17 AD
Reply
04-17-2009, 06:35 PM,
#4
 
Thanks for your input, guys Smile

I'll experiment with cutting out parts of the script that seem unnecessary (for ST's needs) and see if that will make it work.
¤ How to add images or files to your post ¤ Silgrad's UBBCode
My pet peeve: huge images in img code. I reserve the right to make any such image into a clickeable thumbnail whenever I see it.
Angel mired in filth
[Image: SignatureBannerRazorwing.jpg]
Reply
04-29-2009, 10:39 PM,
#5
 
I've gotten my container in-game and basically working now:

[youtube=center]http://www.youtube.com/v/QN6TTbLdiO4[/youtube]

Below is how my modification of the script looks. I think there's a problem with the script in that the backward animation doesn't play. It isn't seen in the video but no matter how many times you open and grab stuff from the closet, it stays open. I wonder if it's supposed to be like that?

Code:
ScriptName StRwScrContainer01

short bDoOnce
ref rOpen
ref rSelf

short sOpen
short sPlayerOwned
short sUpgrade
; short bFast

Begin OnLoad

  If sUpgrade < 1
    Enable
;    If sOpen == 3
;      Set sOpen to 4
;    EndIf
  EndIf

;  If sOpen == 4
;    PlayGroup Stagger 1
;  EndIf

End

Begin OnReset

  Enable
  Set sOpen to 0
  Reset3DState
  Set rOpen to 0
  Set rSelf to 0
  Set bDoOnce to 0

End

Begin OnActivate

  If IsActionRef Player != 1
    Activate
    If sOpen > 0
      PlayGroup Backward 1
      Set sOpen to 0
    Else
      PlayGroup Forward 1
      Set sOpen to 5
    EndIf
    Return
  EndIf

  If IsAnimPlaying == 1
    Return
  EndIf

  If sOpen == 4
    If Player.IsSneaking == 1
      PlayGroup Backward 0
      Set sOpen to 0
    Else
      Activate
    EndIf
    Return
  EndIf

;  Set bFast to ( GetRandomPercent % 3 )

  If GetLocked == 0
    DisablePlayerControls
      PlayGroup Forward 0
    EndIf
    Set sOpen to 3
    Return
  EndIf

  Set sPlayerOwned to 0

  If IsOwner == 1
    Set sPlayerOwned to 1

  ElseIf IsOwner MagesGuild == 1
    If Player.GetInFaction MagesGuild == 1
      Set sPlayerOwned to 1
    Else
      Set sPlayerOwned to -1
    EndIf

  ElseIf IsOwner ThievesGuild == 1
    If Player.GetInFaction ThievesGuild == 1
      Set sPlayerOwned to 1
    Else
      Set sPlayerOwned to -1
    EndIf

  ElseIf IsOwner FightersGuild == 1
    If Player.GetInFaction FightersGuild == 1
      Set sPlayerOwned to 1
    Else
      Set sPlayerOwned to -1
    EndIf

  ElseIf IsOwner StRwRedoran == 1
    If Player.GetInFaction StRwRedoran == 1
      Set sPlayerOwned to 1
    Else
      Set sPlayerOwned to -1
    EndIf

  ElseIf IsOwner PlayerFaction == 1
    If Player.GetInFaction PlayerFaction == 1
      Set sPlayerOwned to 1
    Else
      Set sPlayerOwned to -1
    EndIf
  EndIf

  If sPlayerOwned == 1
    DisablePlayerControls
      PlayGroup Forward 0
    EndIf
    Set sOpen to 3
    Return
  EndIf

  If sPlayerOwned == 0
    If Player.IsInMyOwnedCell == 1
      Unlock
      DisablePlayerControls
        PlayGroup Forward 0
      EndIf
      Set sOpen to 3
      Return
    EndIf
  EndIf

  If GetLocked == 1
    Set sOpen to 1
    Activate
  EndIf

End

Begin MenuMode 1014

  If sOpen == 1
    Set sOpen to 2
  EndIf

End

Begin MenuMode 1008

  If sOpen == 1
    Unlock
      PlayGroup Forward 0
    EndIf
    Set sOpen to 4
  EndIf

End

Begin GameMode

  If sUpgrade < 1
    Enable
    Set rSelf to GetSelf
    If sOpen == 3
      Set sOpen to 4
      PlayGroup Forward 1
    Else
      Set sOpen to 0
      Reset3DState
    EndIf
    Set sUpgrade to 1
    If rOpen != 0
      rOpen.RemoveAllItems rSelf 1
    EndIf
    Set sUpgrade to 2
  EndIf    

  If IsAnimPlaying == 1
    Return
  EndIf

  If sOpen == 5
    PlayGroup Backward 1
    Set sOpen to 0
    Return
  EndIf

  If sOpen == 3
    EnablePlayerControls
    Set sOpen to 4
    Activate
    Return
  EndIf

  If sOpen == 2
    If GetLocked == 1
      Set sOpen to 0
    EndIf
    Return
  EndIf

  If sOpen == 1
    If GetLocked == 1
      Set sOpen to 0
    EndIf
  EndIf

End
¤ How to add images or files to your post ¤ Silgrad's UBBCode
My pet peeve: huge images in img code. I reserve the right to make any such image into a clickeable thumbnail whenever I see it.
Angel mired in filth
[Image: SignatureBannerRazorwing.jpg]
Reply
05-06-2009, 11:57 AM,
#6
 
I have a few questions after looking at your video.

Should the doors open before you empty the container or after you emptied it?

Should the doors close automatically or when you re-activate the container?
Dum loquor, hora fugit  - While I speak the time flies



Ovid 43 BC - 17 AD
Reply
05-06-2009, 01:58 PM,
#7
 
Quote:Originally posted by sandor
I have a few questions after looking at your video.

Should the doors open before you empty the container or after you emptied it?

Should the doors close automatically or when you re-activate the container?

Thanks for looking into it Smile

The first step makes sense as it is right now, that the forward animation is played and then the inventory screen is brought up. It corresponds to pretending that the player opens the doors first and grabs stuff from it second. The second step should ideally be the other way around - the inventory screen is brought up, and after the player closes the inventory screen the backward animation plays. That's where the error lies, that the backward animation never triggers.
¤ How to add images or files to your post ¤ Silgrad's UBBCode
My pet peeve: huge images in img code. I reserve the right to make any such image into a clickeable thumbnail whenever I see it.
Angel mired in filth
[Image: SignatureBannerRazorwing.jpg]
Reply
05-10-2009, 05:44 PM,
#8
 
Thanks for the info, I sent a PM. Smile
Dum loquor, hora fugit  - While I speak the time flies



Ovid 43 BC - 17 AD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)