Jump to content

Need help with a quest script


Gersidi76

Recommended Posts

Hello everyone! I am working on a quest where you have two quest items in your inventory, and when you enter a specific cell your quest items become activatable from your inventory, and when used they trigger a sound effect, are removed, and then a new item is placed in your inventory.

 

Example: you get to the basement. You open your inventory, you have matches and a candle. The matches now have a use function from your inventory. When you use them they and the candle disappear and you are given a 'lit' candle.

 

And ideas??

 

Thanks in advance.

Link to comment
Share on other sites

Remove the first items once the player triggers a box for example, replace them with a "potion" version of them so the player can activate'em from the inventory, and then just that use the mag effects of those potions to create the final effect.

I think it's the best way to do it.

Link to comment
Share on other sites

You can also attach a script to your consumable item that detects if the player is in the correct cell. If not it displays a message box "You can't use this item here" and adds it back to the inventory. If you have to versions of your item (misc and consumable) it might confuse players.

Link to comment
Share on other sites

You can also attach a script to your consumable item that detects if the player is in the correct cell. If not it displays a message box "You can't use this item here" and adds it back to the inventory. If you have to versions of your item (misc and consumable) it might confuse players.

Oh I see what you mean. So I would make the matches a consumable item . is there a way to make it consumable but still have it listed in the misc inventory tab?

 

And what would the script look like?

 

Thanks!

Link to comment
Share on other sites

 

[..] is there a way to make it consumable but still have it listed in the misc inventory tab? [..]

 

 

Well you can use books (books, letters, holotapes) in the misc menu, but that's all I think...

 

If you use a consumable item (don't know the CK name right now) you can attach a magic effect on it. That magic effect can have a script that extends "ActiveMagicEffect" and executes when you use the item. The event you want to use is "OnEffectStart". It would look somehow like this:

scriptname ExampleScript extends ActiveMagicEffect

Message property WrongCellMessage auto const
Cell property TheCell auto const
Potion property TheConsumableItem auto const ;The base item that is used, not sure if Potion is the right script

Event OnEffectStart(Actor akTarget, Actor akCaster)
    if (Game.getPlayer().getParentCell() == TheCell)
        ;do something
    else 
        ;show the message
        WrongCellMessage.show()
        ;give a new item back to the player as the item could not be used
        Game.getPlayer().addItem(TheConsumableItem)
    endif
EndEvent

This is just a quick example. I have not tested it (maybe it won't even compile :D). But this were you could start. Obviously you have to learn a bit scripting for this. For scripting help check the tutorials here: http://www.creationkit.com/fallout4/index.php?title=Category:Papyrus

Link to comment
Share on other sites

 

[..] is there a way to make it consumable but still have it listed in the misc inventory tab? [..]

 

Well you can use books (books, letters, holotapes) in the misc menu, but that's all I think...

 

If you use a consumable item (don't know the CK name right now) you can attach a magic effect on it. That magic effect can have a script that extends "ActiveMagicEffect" and executes when you use the item. The event you want to use is "OnEffectStart". It would look somehow like this:

scriptname ExampleScript extends ActiveMagicEffect

Message property WrongCellMessage auto const
Cell property TheCell auto const
Potion property TheConsumableItem auto const ;The base item that is used, not sure if Potion is the right script

Event OnEffectStart(Actor akTarget, Actor akCaster)
    if (Game.getPlayer().getParentCell() == TheCell)
        ;do something
    else 
        ;show the message
        WrongCellMessage.show()
        ;give a new item back to the player as the item could not be used
        Game.getPlayer().addItem(TheConsumableItem)
    endif
EndEvent
This is just a quick example. I have not tested it (maybe it won't even compile :D). But this were you could start. Obviously you have to learn a bit scripting for this. For scripting help check the tutorials here: http://www.creationkit.com/fallout4/index.php?title=Category:Papyrus

If I made it a book instead of a potion, would it still be extend activemagiceffect? And would it be onread instead of oneffectstart?

Link to comment
Share on other sites

G

A book needs to extend ObjectReference and use the OnRead event. Check the script OnReadAddToMap. Note: If you want to use an alias your script has to extend ReferenceAlias instead of ObjectReference.

Gotcha. Thank you.

 

It's too bad I can't just create a miscobject and set it is an activator that accomplishes all this by clicking on it from my inventory. It's 2016! Lol.

Link to comment
Share on other sites

So here's what I have so far..If the player is in the proper cell and clicks the matches in his inventory, it should silently remove the matches and unlit candle and add the lit candle to the players inventory.

 

scriptname Examplescript extends ReferenceAlias

 

Message property WrongCellMessage auto const

Cell property TheCell auto const

Miscitem property Matches auto const

Miscitem property UnlitCandle auto const

Miscitem property LitCandle auto const

 

Event OnEquipped(Actor akActor)

if (Game.getPlayer().getParentCell() = TheCell)

Game.getPlayer().RemoveItem(Matches, 1, true)

Game.getPlayer().RemoveItem(UnlitCandle, 1, true)

Game.getPlayer().AddItem(LitCandle, 1, false)

else

WrongCellMessage.show()

Endif

endEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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