Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Making Functional Mannequins


Zaldir
 Share

Recommended Posts

Hey guys,

 

I am trying to get some very simple mannequins in a player home I am working on, but I can't seem to get it working.

All I want it to do (currently), is to let the player add the equipment that the Mannequin should wear. The way I am doing this is to have an activator, that when activated, opens the inventory of a chest, where the player puts the equipment. Then, the equipment is transferred to the Mannequin (NPC), removed from the chest, then equipped by the Mannequin. Currently, the script looks like this:

SCN KR3MannequinScript

Ref Mannequin
Ref MannequinCont
Ref InvObj
Short InvPos
Short State
Float fQuestDelayTime

begin GameMode
    Set fQuestDelayTime to .01
    Set Mannequin to MannequinCont.GetParentRef

    If (State == 0)
        Message "State 0"
        Set State to 1
        MannequinCont.Activate player
    ElseIf (State == 1)
        Message "State 1"
        Mannequin.SetDestroyed 0
        Mannequin.SetGhost 0
        Mannequin.PlayGroup Idle 1
        Mannequin.sms EffectStone
        Message "Humanized"
        Set InvPos to MannequinCont.GetNumItems
        While (InvPos > 0)
            Message "Adding items..."
            Set InvPos to (InvPos - 1)
            Set InvObj to (MannequinCont.GetInventoryObject InvPos)
            Mannequin.AddItem InvObj 1
            Mannequin.EquipItem InvObj
            Mannequincont.RemoveItem InvObj 1
        Loop
        If (InvPos == 0)
            Message "Setting State 2"
            Set State to 2
        EndIf
    ElseIf (State == 2)
        Message "State 2"
        StopQuest KR3MannequinQuest
    EndIf
End

The Message lines are just for me to tell where in the script it is currently at when testing.

 

Now, the problem is that the script never gets past the <Message "Humanized"> line, which means there is something wrong with the <Set InvPos to MannequinCont.GetNumItems> line. I am not well versed with OBSE functions, so I am wondering if someone could shed some light on this matter?

 

Thanks!

 

Edit:

The Quest itself is triggered by this script:

SCN KR3MannequinActivationScript

Ref MannequinCont

Begin OnActivate
    If (GetActionRef == Player)
        If (GetQuestRunning KR3MannequinQuest == 0)
            Set MannequinCont to GetParentRef
            Set KR3MannequinQuest.MannequinCont to MannequinCont
            StartQuest KR3MannequinQuest
            Set KR3MannequinQuest.State to 0
        EndIf
    EndIf
End
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...