FormList enable certain Index objects

Post » Sat Aug 06, 2016 7:55 am

Hiya,



Okay, so after searching here, Google and CreationKit.com I can't seem to figure out if we can enable certain Index objects from a FormList.



For Example, take my crates, I need to enable Index numbers, 5, 8, 12 and 20 only, these would change based on player actions (The player will be able to "order" supplies and the supplies comes in these crates. But depending on the amount of supplies the player orders, will dictate how many (or little) crates are enabled.


http://i.imgur.com/MXF9LIq.png<---- Shows the FormList and how many items that might be enabled based on actions (..... Why can't I post an image here anymore?)



How would I enable certain Index Objects? those Index objects and only those?




Before you say just parent them to an Xmarker and enable them that way. I can't, they will be disabled by a different script.



Sure, I could script every single crate to be enabled when needed, but there might be up to 50 that will be enabled.



Thank You :)



---------------


Edit:



I updated the post, to give better details. I was a bit tired when I posted this. Changes are italicized.

User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Sat Aug 06, 2016 11:35 am

There maybe an easy way to do this but this is the route I would take, I would give the crates keywords(if they are non vanilla crates):



Keyword property CrateKeyword auto

Function EnableRefsInFormList()
Int iIndex = MyFormList.GetSize()
While iIndex
iIndex -= 1
ObjectReference CrateRef = MyFormlist.GetAt(iIndex) as ObjectReference
if CrateRef.HasKeyword(CrateKeyword)
CrateRef.Enable()
endif
EndWhile
EndFunction

In theory, the function will only enable crates with that keyword.



I'm unable to test this though.

User avatar
Pawel Platek
 
Posts: 3489
Joined: Sat May 26, 2007 2:08 pm

Post » Sat Aug 06, 2016 2:12 am

I updated the main post, with further information.



Sorry, I was quite tired when I posted, wasn't a good day yesterday.

User avatar
Sam Parker
 
Posts: 3358
Joined: Sat May 12, 2007 3:10 am


Return to V - Skyrim

cron