Jump to content

Need help scripting unique item


JadeMoontail

Recommended Posts

I have this plan for an item you can equip and its supposed to give the player a sample of pink paste once every five hours but I cant for the life of me figure out how to get the script to work and add to the item, I want to use this type of script for a few other items, some lore friendly some just funny.  So if anyone wants to help out jot down an easily adaptable script and how to install it correctly and I am golden

Link to comment
Share on other sites

Most everything in the game that is added to the player is done by a script attached to a quest rather than an object.

Have you tried to find something in the vanilla game that functions similarly to adapt to your purpose?

If not, that is where i would start and at least you will have something to do while you wait a little longer for an actual scripter to reply.

Link to comment
Share on other sites

Here's a quick script you can try. There are other ways to do it but this is probably the simplest.

Create a Quest and add a Quest Alias (Reference Alias) to it.

Quest Alias data ( alias name: Player ; Fill Type: Unique Actor which should point to the Player ; check the Optional flag ).

Click OK, save the plugin.

Reopen the Quest and the Quest Alias then add a new script to it.

  Reveal hidden contents

 

  • Like 1
Link to comment
Share on other sites

  On 6/3/2024 at 5:42 PM, LarannKiar said:

Here's a quick script you can try. There are other ways to do it but this is probably the simplest.

Create a Quest and add a Quest Alias (Reference Alias) to it.

Quest Alias data ( alias name: Player ; Fill Type: Unique Actor which should point to the Player ; check the Optional flag ).

Click OK, save the plugin.

Reopen the Quest and the Quest Alias then add a new script to it.

  Reveal hidden contents

 

Expand  

How do I add this to an item the player wears? I cant seem to figure that out, I want to start off as a ring before I make the actual item as a test

Link to comment
Share on other sites

  On 6/6/2024 at 6:08 AM, JadeMoontail said:

How do I add this to an item the player wears? I cant seem to figure that out, I want to start off as a ring before I make the actual item as a test

Expand  

This script can't be attached to item base forms like Armors or Weapons.

It's a ReferenceAlias script so it works on any actor held in the RefAlias and any item the FormList "Items" contains.

Make sure the Player is filled into the Quest Alias and fill out the script properties in the editor. Drag and drop the item base forms to the FormList.

If you'd like to have a script attached to the items themselves, you'll need to make a script that extends ObjectReference instead.

 

  On 6/6/2024 at 12:49 AM, JadeMoontail said:

Should this work if I change the items it adds for different upgrades in a work bench?

Expand  

Yes. The FormList "Items" contains the items' base forms and not the item instances themselves. Modifying them doesn't affect the script.

Link to comment
Share on other sites

  On 6/6/2024 at 9:21 AM, LarannKiar said:

This script can't be attached to item base forms like Armors or Weapons.

It's a ReferenceAlias script so it works on any actor held in the RefAlias and any item the FormList "Items" contains.

Make sure the Player is filled into the Quest Alias and fill out the script properties in the editor. Drag and drop the item base forms to the FormList.

If you'd like to have a script attached to the items themselves, you'll need to make a script that extends ObjectReference instead.

 

Yes. The FormList "Items" contains the items' base forms and not the item instances themselves. Modifying them doesn't affect the script.

Expand  

So I replace akBaseObject with the item I want it to use?

Link to comment
Share on other sites

  • 2 weeks later...
  On 6/3/2024 at 5:42 PM, LarannKiar said:

Here's a quick script you can try. There are other ways to do it but this is probably the simplest.

Create a Quest and add a Quest Alias (Reference Alias) to it.

Quest Alias data ( alias name: Player ; Fill Type: Unique Actor which should point to the Player ; check the Optional flag ).

Click OK, save the plugin.

Reopen the Quest and the Quest Alias then add a new script to it.

  Reveal hidden contents

 

Expand  

How could this be altered to make it work for any NPC? Would like to make like a "Scavver Ring" that they pic up random scrap material over time

Link to comment
Share on other sites

  On 6/22/2024 at 7:10 AM, JadeMoontail said:

How could this be altered to make it work for any NPC? Would like to make like a "Scavver Ring" that they pic up random scrap material over time

Expand  

You'll need another script to dynamically change the Actor Reference the ReferenceAlias holds ( with ForceRefTo() ) or alternatively alter the script I wrote for ReferenceCollectionAliases.

Link to comment
Share on other sites

  On 6/22/2024 at 5:39 PM, LarannKiar said:

You'll need another script to dynamically change the Actor Reference the ReferenceAlias holds ( with ForceRefTo() ) or alternatively alter the script I wrote for ReferenceCollectionAliases.

Expand  

Having trouble getting scripts to compile at all. mind if I shared the work in progress mod files so you can check what I am doing and help me get it working and explain what I am doing wrong. Will list your username in the description when I upload the mod for your help

Edited by JadeMoontail
Link to comment
Share on other sites

  • Recently Browsing   0 members

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