Jump to content

Papyrus and General Mod Help


Th4nat0s1s

Recommended Posts

Sweet, thanks! Let me modify my code and check it out and I will update in a few!

 

UPDATE::

Ok! Now the buffs are applying correctly, I made two brand spanking new Magic Effects. I pretty much copied the effect EnchFortifySmithingConstantSelf I just changed the names and then added the ability to define a duration. But now it seems that the timer isnt ticking down eventhough it shows that it has a timer in the Effects tab in game. Also, when I tried upgrading some armor it didnt really seem to do much.... I was still only scrafting Fine armor.... is there something I am missing there?

 

Also, it still seems to not want to eat the salts for some reason....

Edited by Th4nat0s1s
Link to comment
Share on other sites

ScriptName TT_Forge_BuffSwitch extends ObjectReference

 

;==========

;PROPERTIES

;==========

 

Spell Property TT_LesserFortifyBlacksmithing Auto

Spell Property TT_GreaterFortifyBlacksmithing Auto

 

Ingredient Property FireSalts Auto

 

Int Property MaxBuffAmt = 10 Auto

Int Property MinBuffAmt = 5 Auto

 

ObjectReference Property TT_Forge_Cup_FireSaltsDepo Auto

 

;======

;Events

;======

 

Event OnActivate(ObjectReference akActivator)

If TT_Forge_Cup_FireSaltsDepo.GetItemCount(FireSalts) >= MaxBuffAmt

Game.GetPlayer().AddSpell(TT_GreaterFortifyBlacksmithing)

TT_Forge_Cup_FireSaltsDepo.RemoveItem(FireSalts) == MaxBuffAmt

debug.notification("The forge bursts to life!")

ElseIf TT_Forge_Cup_FireSaltsDepo.GetItemCount(FireSalts) >= MinBuffAmt

Game.GetPlayer().AddSpell(TT_LesserFortifyBlacksmithing)

TT_Forge_Cup_FireSaltsDepo.RemoveItem(FireSalts) == MinBuffAmt

debug.notification("You see the flames brighten slightly in the forge...")

ElseIf TT_Forge_Cup_FireSaltsDepo.GetItemCount(FireSalts) < MinBuffAmt

debug.notification("You don't have enough to charge the forge...")

EndIf

EndEvent

Link to comment
Share on other sites

the removeitem lines are not right, check my previous post, you need to pass the amount as a parameter, when in doubt check the wiki:

http://www.creationkit.com/index.php?title=RemoveItem_-_ObjectReference

 

As for the duration, it's not going to work easily with addspell since you adding abilities, that are constant. It's been mentioned previously on the thread if i remember right. You need a way to remove those spells once out of the workstation. One is requiring skse and using http://www.creationkit.com/index.php?title=OnMenuClose_-_Form

 

But i'm sure there are ways to do it without skse. My idea: Trigger box covering the workstation with space, so once crafting the player will be perfectly within it. This script on it that literally removes the spells when walking out of the workstation if the player has them.

Spell Property TT_LesserFortifyBlacksmithing Auto
Spell Property TT_GreaterFortifyBlacksmithing Auto
Actor Property PlayerRef Auto

Event OnTriggerLeave(ObjectReference akActionRef)
If PlayerRef.HasSpell(TT_LesserFortifyBlacksmithing)
 PlayerRef.RemoveSpell(TT_LesserFortifyBlacksmithing)
Elseif PlayerRef.HasSpell(TT_GreaterFortifyBlacksmithing)
  PlayerRef.RemoveSpell(TT_GreaterFortifyBlacksmithing)
Endif
EndEvent
Edited by FrankFamily
Link to comment
Share on other sites

So your saying my integer properties are pointless because they won't use the defined amount after the equals sign as the integer amount? I'm sorry I don't understand what you mean....

 

So should I write it

 

TT_Forge_Cup_FireSaltsDepo.RemoveItem(FireSalts, 5) ?

Edited by Th4nat0s1s
Link to comment
Share on other sites

No no, the properties are fine, what's not right is the sintax of the function:

TT_Forge_Cup_FireSaltsDepo.RemoveItem(FireSalts) == MaxBuffAmt

"==" is for comparing stuff so that is kind of weird. Remove item has two parameters, the form to remove and the amount (optionally silent remove and a container to send the item instead of vanishing them) This amount can be a number or a property/variable or the result of an operation. So it should be:

TT_Forge_Cup_FireSaltsDepo.RemoveItem(FireSalts, MaxBuffAmt)
Edited by FrankFamily
Link to comment
Share on other sites

 

the removeitem lines are not right, check my previous post, you need to pass the amount as a parameter, when in doubt check the wiki:

http://www.creationkit.com/index.php?title=RemoveItem_-_ObjectReference

 

As for the duration, it's not going to work easily with addspell since you adding abilities, that are constant. It's been mentioned previously on the thread if i remember right. You need a way to remove those spells once out of the workstation. One is requiring skse and using http://www.creationkit.com/index.php?title=OnMenuClose_-_Form

 

But i'm sure there are ways to do it without skse. My idea: Trigger box covering the workstation with space, so once crafting the player will be perfectly within it. This script on it that literally removes the spells when walking out of the workstation if the player has them.

Spell Property TT_LesserFortifyBlacksmithing Auto
Spell Property TT_GreaterFortifyBlacksmithing Auto
Actor Property PlayerRef Auto

Event OnTriggerLeave(ObjectReference akActionRef)
If PlayerRef.HasSpell(TT_LesserFortifyBlacksmithing)
 PlayerRef.RemoveSpell(TT_LesserFortifyBlacksmithing)
Elseif PlayerRef.HasSpell(TT_GreaterFortifyBlacksmithing)
  PlayerRef.RemoveSpell(TT_GreaterFortifyBlacksmithing)
Endif
EndEvent

So, all this does.... is if the player character has the spell due to using the firesalts switch, then when they leave the defined box (read: crafting area) (eg when they leave the menu and proceed about their business) it removes the spell?

 

Also, I want the spell to persist for long enough that they can maybe upgrade the crafted item.... because the way I understand the buff, it doesnt affect created items, only upgrades to pre-existing items.... so actually, using on the forge itself is pointless for what I gather, and lastly, if that is true then what the hell does "whats his face" in Riften actually do when you give him the firesalts.... like how does it affect his crafting?

 

PPS: I thought about using the SKSE thing, but I am not exactly sure that would work either... since it seems that would kill the magiv effect upon exiting the crafting menu, which I also dont actually want.... I am starting to think that it might be impossible to implement this the way I want.... >_<

Edited by Th4nat0s1s
Link to comment
Share on other sites

That guy in Riften is just a quest. It doesn't change anything.

 

You want the buff for tempering? Go the triggerbox route as FrankFamily stated, but make that box huge enough to cover the entire crafting area (i.e. forge, workbench, grinding wheel, smelter, etc...) That way, while they are walking around making and tempering stuff they'll have the buff active. When they leave that area, the buff will be removed.

 

Using the Hearthfires house as an example:

For the basement crafting stations, you'd place the triggerbox to cover the entire back half of the basement where the stations are located. When the player walks into the back half, the triggerbox gives them the buff. They craft and temper as they desire. Then they enter the front half of the basement and the buff is removed from them.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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