Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

That makes good sense.

 

EDIT: I added the new amount in the properties window, do I also need to add the recipe there too? If so, what would I set the value to? If I set the type 'constructable object', and the name MyRecipe, when I use the value ellorecipefoodsalmonsoup, or another of the recipes, if fails to add it to the properties saying that there is no viable alternative, but it adds the line to the script

 

ConstructibleObject Property MyRecipe = ElloRecipeFoodSalmonSoup Auto

 

Clearly I'm doing something wrong.

 

EDIT 2: I finally worked out that I need to leave it blank and then choose the recipe from the dropdown box.

 

I've double checked that I have the magic effect applied to the spell, and the spell added as an ability to the perk, however once my player has the perk it is unfortunately not working. Is there anything else that I need to change or adjust? The magic effect is Effect Archtype script, constant on self, with no other ticks or changes and the script added and the two properties defined. I did initially have 'recover', 'no area' and 'no magnitude' ticked but it didn't work like that, either. (and yes, I am using SKSE).

Edited by Ellorienne
Link to comment
Share on other sites

Scripting with spells & magic effects has always been tricky for me. While I've done some, it was a whole lot of trial and error. Start with just a simple notification or trace statement on the script and use that as a guide to ensure that you get the spell & effect settings setup correctly. Once that is going, start modifying the script as needed.

 

You could try using the perk's script fragment section to run the necessary code without messing with a spell's magic effect.

Link to comment
Share on other sites

Thank you for your continued help :) How does the trace ensure that it is set up correctly? I've seen some of those used in various scripts that I have looked at (for example letting you know that you have perks available, or gained an item). The magic effect Scavenger was visible in active effects once I purchased the perk, but it didn't do anything when the food was crafted. Nor did it work when I added it directly to the perk.

Link to comment
Share on other sites

A trace or notification statement can let you know things like a specific event has triggered or a specific IF statement is valid etc... It is useful a lot of times to put in trace or notification statements so that you as the mod author can be assured that things are happening as you expect. In the final product you can comment out those statements so that the user is not bombarded with things they don't want or necessarily need to see.

Link to comment
Share on other sites

I also tried adding it to the cookpots to see if that would help.

 

Scriptname ElloPerkScavenger50 extends ObjectReference

ConstructibleObject Property MyRecipe Auto
Int Property NewAmount Auto
GlobalVariable Property ElloPerkScavenger50 auto

Event OnActivate(ObjectReference akActionRef)
MyRecipe.SetResultQuantity(NewAmount, ElloPerkScavenger50.GetValueInt())
EndEvent

 

Other than adding the perk in the property window, is there anything else I need to do so that it recognises that I have that perk? It didn't throw up any errors or failures, but it didn't work in-game either. I still only got 1 salmon soup :( I love how open-ended modding solutions can be, but it can also be a bit of a pain when you're looking for something that works. I may just have to take the 'brute force' option (4x the recipes).

Link to comment
Share on other sites

What value did you assign to the NewAmount variable?

Why do you have the global variable inside the function call?

 

There can only be one INT variable inside the function call. Either use your global variable or assign it to the NewAmount variable.

 

One of the following:

Event OnActivate(ObjectReference akActionRef)
  NewAmount = ElloPerkScavenger50.GetValueInt()
  MyRecipe.SetResultQuantity(NewAmount)
EndEvent

Or

Event OnActivate(ObjectReference akActionRef)
  MyRecipe.SetResultQuantity(ElloPerkScavenger50.GetValueInt())
EndEvent
Link to comment
Share on other sites

I had seen it used in a similar way in another piece of code, although I probably didn't quite understand how it was used, if that is the case. The idea was to add a condition so that the script only runs if the player has the perk. I thought I remembered something about adding conditions in the brackets afterwards, though I may just have read too much in one day and become confused. Perhaps an 'if' statement instead?

Link to comment
Share on other sites

The activate event of the crafting station will be too late for any changes to the recipe to take effect. Where is it that the perk is being applied to the player? If it is scripted, that point may be the best location to change the quantity of the recipe.

 

A alternate possibility if trying to get this SKSE function to work is too much of a nightmare, there is the Craft Item story manager event/node. You could possibly do something with that. It would still be a check if the player obtained X item and add Y more. But because the quest holding the script would only run when the player crafted items, it would prevent improper increases when the player picks the object up off the ground or takes it out of a container.

Link to comment
Share on other sites

I have given some consideration to that event, too. Unfortunately for me a lack of scripting knowledge has me going around in circles every time I think about trying to just wing it and mash together some pieces of script. I do thank you for your help though, but I think I'll do this the heavy-handed way and just make duplicate recipes and add conditions to them. It's a lot more work, but I can do that, and I should be able to change it later if/when I improve.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...