Jump to content

More Scripting Problems


AngryBananaStudios

Recommended Posts

You probably need to have a Property that points to the item you want to use and/or interact with. If you do not have one already, that is. Either that, or you can use Game.GetFormFromFile with the form ID (and maybe a cast, but not necessarily) to get access to the thing. Use GetFormFromFile (not GetForm) unless you want to force users to have the mod loaded at a specific load order slot. If you did not know already, the first two characters in the form ID are the load order index for the plugin, in hexadecimal format, and will depend on the load order. Or something like that, I think, the main point is that they depend on load order slot for the plugin, and you should not use them unless you know what you are after.

 

These might help:

http://www.creationkit.com/index.php?title=Variables_and_Properties

http://www.creationkit.com/index.php?title=GetFormFromFile_-_Game

 

Happy modding. :thumbsup:

 

Edit: Typos... grrrrr... I obviously cannot type anymore. Must be the Internet's fault. :wallbash:

 

Edit 2: As in, maybe something like this (with the Property defined in the fragment Property editor, not in the fragment script box):

Form Property YourForm Auto
Game.GetPlayer().AddItem(YourForm, 1, False)

But you either need or not change the type to something else to be able to fill the property with the right object.

 

The GetFormFromFile would be something a bit like this maybe (the cast is not necessary with 99% certainty, just there for example of a cast):

Game.GetPlayer().AddItem(Game.GetFormFromFile(0x000115BC, "YourPluginName.esp") as Form, 1, False)

Hopefully that helps a little.

Edited by Contrathetix
Link to comment
Share on other sites

  • Recently Browsing   0 members

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