Jump to content

Creation Kit: How to make item undroppable?


azzendix

Recommended Posts

SOLVED.








I'm very beginner to scripting. Hope someone can help me.


Problem:

The player can drop ring from my mod even I assign it as quest object already.

How to make this ring undroppable? What am I doing wrong?


Detail:

I create a script to show message box every 20 mins and use the ring to toggle notification.(equip to show the message box. unequip to hide message box.)

I add the ring to quest alias with type "Create Reference to Object," "Create In" Player. Screenshot1 / Screenshot2.

I use this command give ring to the player automatically when running this script for the first time.


PlayerRef.Additem(TakeCareRing, 1, True)

Edited by azzendix
Link to comment
Share on other sites

Just in case someone wants to see full script.
This is the quest script.

 

 

Scriptname _TakeCare_Main extends Quest
{This is main script. Display messages every 20 minutes.}


Actor Property PlayerRef Auto
Armor Property TakeCareRing Auto
Message Property _TakeCare_Msg Auto
GlobalVariable Property _TakeCare_Time Auto
Int Property Status = 0 Auto


Event OnInit()
Debug.Notification("Take Care of Your Eyes has been activated.")
PlayerRef.Additem(TakeCareRing, 1, True)
RegisterForSingleUpdate(_TakeCare_Time.GetValue())
endEvent


Event OnUpdate()
if (Status == 1)
_TakeCare_Msg.Show()
endIf
RegisterForSingleUpdate(_TakeCare_Time.GetValue())
endEvent

 

 

This is the ring script.(attach to the ring object in armor section.)

Scriptname _TakeCare_Ring extends ObjectReference
{Equip/Unequip to show/hide message box.}


Actor Property PlayerRef Auto
_TakeCare_Main Property _TakeCare_Main_Property Auto


Event OnEquipped(Actor akActor)
if akActor == PlayerRef
Debug.Notification("Show message box.")
_TakeCare_Main_Property.Status = 1
endIf
endEvent


Event OnUnequipped(Actor akActor)
if akActor == PlayerRef
Debug.Notification("Hide message box.")
_TakeCare_Main_Property.Status = 0
endIf
endEvent

Link to comment
Share on other sites

the whole quest is not running.

I tested the mod with my game. I think both script quests are running because I can see message "Take Care of Your Eyes has been activated." at first and "Show message box." "Hide message box." when equip/unequip ring.

The message box stop shows up after unequip ring. The script is working as intended.

 

 

 

alias is not getting filled

Not sure I understand about "filled". Do you mean the value of the property?

Please check these images.

 

 

XNeCYBx.png

Dei88zA.png

 

 

Edited by azzendix
Link to comment
Share on other sites

  • Recently Browsing   0 members

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