Script Assistance Needed.

Post » Wed Aug 14, 2013 12:12 pm

Im looking for someone who understands scripting, ive tried tutorials and experimenting with other scripts to see how they work and i just havent been able to get the knack for it yet.

Basic outline, I want to click an object (pedestal activator in this case), the scripts pops up a message to ask "what to do" (Place item -- Remove Item -- Nothing). If Place item is used have the script check to see if an item is in inventory, if so remove it from the player and put it in a container (outside the world for storage) and meanwhile activate an "initially disabled" static object to fade in. Remove item can remove all the items in the box if it cant specify a single item.

I have a script from a mod that does this exactly (its a Daedric artifact display one), except the items in the properties list are set to -weapon, armor, soulgem- and the like, and i need one to do exactly what it does but for static items (misc.). I only have the PEX files and not the PSC so i cant rip it apart myself to try to see how it was done, and ive tried contacting the author but so far without success.

So im hoping someone who understands this stuff can whip one up in a few minutes or point me to a PSC file that might be similar i can try to learn from to do it myself.

Thank you in advance.

User avatar
Ria dell
 
Posts: 3430
Joined: Sun Jun 25, 2006 4:03 pm

Post » Wed Aug 14, 2013 3:03 pm

You'll have to rename the properties to perhaps something more meaningful to you (your description was a bit generic) but hopefully you get the idea.

Spoiler

scriptname everseeingScript extends ObjectReference{Attach this script to the activator you wish to use.};Script file name must match the scriptname identifier above: i.e. everseeingScript.psc;Property definitionsActor property PlayerRef autoForm property someItem autoObjectReference property someContainer autoObjectReference property someStaticObject automessage property everseeingChoiceMenu automessage property someErrorMessagePlayerNoItems automessage property someErrorMessageContainerNoItems auto;EventsEvent OnActivate(ObjectReference akActionRef)    if akActionRef == PlayerRef        DisplayChoiceMenu()    endifendEvent;Functionsfunction DisplayChoiceMenu()    int i = everseeingChoiceMenu.Show()    if i == 0        ;Place the item        if PlayerRef.GetItemCount(someItem) > 0            ;Objects in the player's inventory are, in general, not persistent,            ;so let's add and subtract instead.            PlayerRef.RemoveItem(someItem)            someContainer.AddItem(someItem)            someStaticObject.Enable(true)        else            someErrorMessagePlayerNoItems.Show()        endif    elseif i == 1        ;Remove the item from the container and give it to the player.        if someContainer.GetItemCount(someItem) > 0            someContainer.RemoveItem(someItem)            PlayerRef.AddItem(someItem)        else            someErrorMessageContainerNoItems.Show()        endif    else        ;Do nothing.    endifendFunction


Edit: added missing message property definition.
User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Wed Aug 14, 2013 1:01 am

Wow fast reply thank you, I will try it and do what i cant to rip it apart and see if i can learn how to get it to do what i want and all.

Thank you again for this and the speedy reply.

User avatar
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am


Return to V - Skyrim