Jump to content

Formlist in a Script


Allannaa

Recommended Posts

I could swear this has been asked and answered before, but I can't find the thread.

 

Is it possible to use a form list in a script?  For instance....

 

I want to make it possible to give a gift to any NPC.

 

I'd write a "quest" that is start-game enabled, and probably "run once".

 

I'd write "player dialog" such as, "Here, this is for you" or  "I want you to have this".

 

The NPC response would be "Wow, thanks!" for people; for dogs it might be "Bark, bark"; for horses it might be "Neigh" or something (you get the idea).  Then they'd be your friend  -- NOT your follower, you'd just have a better relationship rank with them.

 

The "gift of charity" buff would be added.

 

But here's the thing -- if it's a dog (or a named dog like Stump) -- well, I don't want to give it gold or skooma, right?  I want to give chicken breast, or raw rabbit leg, or something.  If it's a horse, I don't want to give it gold or meat, I want to give it an apple, or a carrot.  If it's a child, I want to give sweets or a dollly or a wooden sword.  If it's an adult, I want to give food or a piece of armour perhaps, or a flower.

 

So, um.... How do I proceed?

 

This is what I *think* I should be doing:

 

(I'm actually not even sure where this should go -- Topic Info window?? Here, this is for you -- and the response in the "Response text"; then in the Conditions window Target is dog or horse, and the "remove item" and "add item" are from the dog or horse formlist?)

game.getplayer().removeitem(gold, some amount, or do I do this as a float??)
(what should go here??).additem(gold)

game.getplayer().removeitem(chicken breast, or could I do "FormlistDoggies" ??)
(what should go here??).additem(thing from formlist??)

game.getplayer().addspell (gift of charity)


if 
akspeaker.getrelationshiprank(Game.getPlayer()) < 1
akspeaker.setrelationshiprank(Game.getPlayer(), 1)
endif

MiscObject Property Gold  Auto  

Potion Property apple02 Auto  

Spell Property charity  Auto  

Am I on the right track?  I tried googling this, and looking in the CK Wiki, but all I got was "watch this video" bullshit -- and I don't DO video, not on rural internet, and with a hearing problem, I don't.

 

Do I even need a formlist?  Or can I just do something that opens the player's inventory and allows the player to choose what to give the dog, kid, or random citizen?

 

Do I even need a quest to add dialog?? Pretty sure I do, even if it's just the one line "Here, this is for you." let alone the ability to actually GIVE the item.

 

Thanks!
 

Link to comment

SirSalami has a dialog set up to give a gift to any npc in his mod here http://www.nexusmods.com/skyrim/mods/63874/?

You could deconstruct his method for your own situation.

 

His dialogue introduction is constrained by the condition that you do not wear a helmet when you initiate it.  So if you want to mess around with it in game.. keep that in mind.

Or remove the condition from the "Greetings.." dialogue.

 

ETA:

The editor ID of the gift giving portion is held within dialog topics 02008f0C and 02008f0D and refers to script Sirsal_sf_speechcraft_gift

 

Further ETA:

I double checked that mod... source files not included.. so you would need to depex it =/  or see if you can load it in CK

Link to comment

oh, drat.  I don't have a PEX un-doer that I've ever gotten to work.

 

I did look at the beggar stuff in the CK, though, and at the wilderness stuff.  Now I'm even more confused lol

 

It seems as if this *should* be simple, but um.... wow.

 

ETA ooh, thanks for the link, I'll go look at that.

Link to comment

All righty, this is what I have so far.  Am I on the right track here?

Should the "Spell Property" actually be the Gift of Charity spell?

And I need to actually create the Formlist "GoodyList" and fill it with things allowed to be given.

Actor Property PlayerREF Auto
FormList Property AllaGoodiesList Auto
Spell Property FavorJobsBeggarsAbility  Auto

  Function GivePresent()
     AddInventoryEventFilter(GoodyList)
     ShowGiftMenu(True, AllaGoodiesList, False, False)
     RemoveAllInventoryEventFilters()
  EndFunction
;pops up Gift Menu so player can give something

  Event
     OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
          If akSourceContainer == PlayerREF
    RemoveItem(akBaseItem,aiItemCount)  ;to give the item to the NPC or animal ?
                    If akspeaker.GetRelationshipRank(Game.GetPlayer()) == 0
                         akspeaker.SetRelationshipRank(Game.GetPlayer(), 1) ;to make NPC like player
                    EndIf
          EndIf
   EndEvent

FavorJobsBeggarsAbility.Cast(Game.GetPlayer(), Game.GetPlayer()) ;to add Gift of Charity buff
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use