Jump to content

[LE] Quick Questions, Quick Answers


Recommended Posts

 

I'm curious about script inheriting. Is this more efficient than placing a new script on references?

 

For example if all the references are going to do the same thing like, count how many of something is in formlist(but each formlist will be a different list), should all of them use a "base" script and just change the properties, or should they each have their own script?

 

As I'm thinking 7 references with the same script = 7 instances of 1 script.

 

The big thing is with properties that you only need to write the code once, much the same way functions help out. Makes scripting stuff much less of a chore. I don't know which is more efficient ingame, but frankly it doesn't matter; the benefits for flexibility, troubleshooting, and maintenance are far too overwhelming to deny.

 

 

According to the wiki, it is better to reuse scripts because it reduces the number of scripts that have to be loaded into memory at a given time. This is why all of those "default" scripts were created by the developers, to hopefully minimize the need of the many questmakers and other developers adding multiple scripts with identical functionality.

Link to comment
Share on other sites

hi! i have a translation mixing language problem, but where? where are these temper words "Fine, Superior, Exquisite, Flawless, Epic, Legendary" to translate? where are store these words? and some weapons gets mixing like example: "espada de hierro of minor animus", but where are these english words? i dont see with tes5edit filtered by name!

Link to comment
Share on other sites

The temper words are found in the game settings and are not shown in xEdit by default. A plugin has to modify them and then it will show the modified values. A work around that you could suggest to users would be to use Numerical Smithing Upgrades. Or you can just look at that mod to see what they edited.

 

As far as the other, I don't really know.

Link to comment
Share on other sites

I have a Papyrus error being thrown and I can't for the life of me figure out why:

 

This code:

    Debug.Trace("SM: Mannequin: Item: " + akBaseItem.GetName() + ": Removed")
    QueueNiNodeUpdate()
    if bThieving
        Debug.Trace("SM: Mannequin: Sending theft update!")
        Debug.Trace("SM: Mannequin: OnItemRemoved: Item Count: " + GetNumItems())
        if GetNumItems() > 0
            Form[] myInventory = GetContainerForms()
            if myInventory == none
                Debug.Trace("SM: Mannequin: OnItemRemoved: Failure in getting inventory array")
            else
                Debug.Trace("SM: Mannequin: OnItemRemoved: Array Length: " + myInventory.Length)
                ;myChestAlias.UpdateLists(myInventory, self)
            endif
        else
            ;myChestAlias.UpdateLists(new Form[10], self)
        endif
    endif

Produces this log:

[04/24/2017 - 10:30:10PM] SM: Mannequin: Item: Hide Helmet: Removed    
[04/24/2017 - 10:30:10PM] SM: Mannequin: Sending theft update!    
[04/24/2017 - 10:30:10PM] SM: Mannequin: OnItemRemoved: Item Count: 4    
[04/24/2017 - 10:30:10PM] Error: Cannot cast from None to Form[]    
stack:    
    [ (7E00F200)].foamstoremannequinactor.OnItemRemoved() - "foamStoreMannequinActor.psc" Line ?
[04/24/2017 - 10:30:10PM] SM: Mannequin: OnItemRemoved: Array Length: 4    

Any thoughts? GetContainerForms is supposed to return a Form[] array, and obviously does actually do so, since the Length operation succeeds, but the Papyrus VM is whining at me. Further casting errors are thrown when I attempt to pass a Form[] as an argument to a function that expects a Form[], regardless of how those Form[] are generated (up to and including an explicit declaration of "new Form[10]" -- this apparently produces a "none" as the output according to the VM, despite all further processing on it proceeding without error.)

 

I'm stumped. Things work, but...

Edited by foamyesque
Link to comment
Share on other sites

The GetContainerForms function won't return a None. It will return an array of length zero if there are no items.

 

Arrays are special and just declaring an array variable assigns it to an initial zero length array.

 

To see if it's empty or uninitialized you can test any array variable with

if myInventory.length == 0

or

if !myInventory.length

or even simply

if !myInventory

but comparing an array to None will always fail.

Link to comment
Share on other sites

What's the best way to replicate the constantly running quest to sell produce to farmers? I tried recreating it to no avail.

 

Edit: Got it!

Edited by SevenBlue
Link to comment
Share on other sites

Argh.

 

I have an NPC I want to be able to do the following things to:

 

1. Pickpocket (so it has to be directly activateable, as far as I can tell)

2. Execute custom processing when activated in non-sneak mode (using a perk to override the [E] Talk text, have OnActivate processing all ready to go)

3. Not have it say a hello when activated in non sneak mode. I could swear I had this going at one point but as of right now, even with VoiceType NONE, I get generic dialog.

 

Anyone know of a way to either make that silent or not happen at all?

EDIT:

Creating an empty voicetype seems to've done the trick, but I'm certain there's another way. Bleh.

Edited by foamyesque
Link to comment
Share on other sites

If a player is at an activator that is going to teleport him on activation, but has a follower with him, how do I teleport the follower as well?

Edit: Hmm I think I have a method. Just check if the Follower alias is empty or not and then check their location against the players'.

Edited by Lisselli
Link to comment
Share on other sites

  • Recently Browsing   0 members

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