Jump to content

[LE] Formlist Scripting....


Pyrathas

Recommended Posts

So I have a script for Dragon Claws, but I want to make it to where the Player can open a container, place the items in the said container, and the static versions are enabled on the wall.

 

MiscObject Property ClawToPlace Auto
{The claw we want to place}
Bool Property isPlaced = false Auto Hidden
Message Property FailMessage auto
{The message to show if the player dont have the claw in their inventory}

Event OnActivate(ObjectReference akActivator)
if(isPlaced == FALSE) ; is the claw placed?
if akActivator.getItemCount(ClawToPlace) >= 1 ; Does the player have the claw?
isPlaced = TRUE
self.getLinkedRef().enable() ; Enable the Static Claw
(akActivator as actor).removeItem(ClawToPlace, 1) ; Remove the claw from the players inventory
else
FailMessage.show() ; If the player doesnt have the claw, show the Fail message.
endif
else
isPlaced = FALSE
self.getLinkedRef().disable() ; If the claw was already placed, disable the static claw
(akActivator as actor).addItem(ClawToPlace, 1) ; add the claw back.
endif
endEvent

From what I understand I need a formilst script. So It would begin with something like this:

FormList Property FormItem Auto

So How would I make it possible to enable/disable multiple static Items? And restrict

I know there are people that have resources available, but I want to understand these scripts while making it less wordy...

 

 

Link to comment
Share on other sites

This shows how restrict certain items for containers

By enable/disable multiple statics do you mean disable/enable several statics at once? If so then add an xmarker and go to each static item you want enabled or disabled, and under Enable Parent select the xmarker. Make sure the marker is disabled by default and then add it as an ObjectReference Property and you'd want to disable/enable this instead.

Link to comment
Share on other sites

This shows how restrict certain items for containers

By enable/disable multiple statics do you mean disable/enable several statics at once? If so then add an xmarker and go to each static item you want enabled or disabled, and under Enable Parent select the xmarker. Make sure the marker is disabled by default and then add it as an ObjectReference Property and you'd want to disable/enable this instead.

no I mean I want to enable one static per object, however in a formlist fashion. Like you click the activator and triggers multiple statics individually lile Player activates display, if item is in formlist, static is enabled. if not it is rejected.

Link to comment
Share on other sites

Most simplistic method. Not tested for compilation or function. Script goes on the container. Issues might arise with adding or removing large numbers in one go. Requires two formilsts, one for the item and one for the display. Entries on the two lists should be matching. i.e. gold claw at index 0, gold claw display at index 0

 

 

FormList Property ClawList Auto
FormList Property DisplayList Auto

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
	If ClawList.HasForm(akBaseItem)	;only work with items on our list
		Int index = ClawList.Find(akBaseItem)	;get index of item in list
		ObjectReference Display = DisplayList.GetAt(index) as ObjectReference	;get matching display from display list
		Display.Enable()	;enable display
	EndIf
EndEvent

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
	If ClawList.HasForm(akBaseItem)	;only work with items on our list
		Int index = ClawList.Find(akBaseItem)	;get index of item in list
		ObjectReference Display = DisplayList.GetAt(index) as ObjectReference	;get matching display form display list
		Display.Disable()	;disable display
	EndIf
EndEvent
 

 

 

Link to comment
Share on other sites

This shows how restrict certain items for containers

By enable/disable multiple statics do you mean disable/enable several statics at once? If so then add an xmarker and go to each static item you want enabled or disabled, and under Enable Parent select the xmarker. Make sure the marker is disabled by default and then add it as an ObjectReference Property and you'd want to disable/enable this instead.

 

Thanks, I'll give it a go!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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