Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

Any way to add a magic effect to an actor through a script?

 

Any way to change the magnitude of a magic effect through a script?

 

I want an actor to lose 0.0023% of his maximum(BaseActorValue) magicka every second, setting a negative value for MagickaRate doesn't work, so I have to find an alternate way.

 

I've been also looking for a way to add a cooldown to a Lesser Power, if you can give me an idea that'd be great.

 

Thanks in advance.

Edited by Kerberus14
Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Any way to add a magic effect to an actor through a script?

 

Any way to change the magnitude of a magic effect through a script?

 

I want an actor to lose 0.0023% of his maximum(BaseActorValue) magicka every second, setting a negative value for MagickaRate doesn't work, so I have to find an alternate way.

 

I've been also looking for a way to add a cooldown to a Lesser Power, if you can give me an idea that'd be great.

 

Thanks in advance.

Put your MGEF on a spell (constant, self) and add that spell to your actor thru the script:

MyActor.AddSpell(SpellProperty)

You can set magnitude with SKSE. If your MGEF is the only MGEF on your spell, it's index would be 1 (there's a column where you can see the index number in the spell):

MySpell.SetNthEffectMagnitude(1, MyFloat)

However, the magnitude will be forgotten upon game reload so you'll have to add a script to your alias:

Event OnPlayerLoadGame()

     MySpell.SetNthEffectMagnitude(1, MyFloat)

EndEvent
Link to comment
Share on other sites

http://www.creationkit.com/ConstructibleObject_Script

 

SetNthIngredient(Form required, Int n)

  • Changes the specified ingredient needed by this recipe.

SetNthIngredientQuantity(Int value, Int n)

  • Changes the quantity needed of the specified ingredient for this recipe.

 

What does the Int n stand for?

 

And how can I use these? Do I have to make a function for each or what? I don't fully understand.

Edited by Kerberus14
Link to comment
Share on other sites

http://www.creationkit.com/ConstructibleObject_Script

 

SetNthIngredient(Form required, Int n)

  • Changes the specified ingredient needed by this recipe.

SetNthIngredientQuantity(Int value, Int n)

  • Changes the quantity needed of the specified ingredient for this recipe.

 

What does the Int n stand for?

 

And how can I use these? Do I have to make a function for each or what? I don't fully understand.

It's SKSE functions, so you just need to have the SKSE source scripts installed (install SKSE with 7z archive).

 

I believe n is the specified ingredient index for that recipe.

Link to comment
Share on other sites

I have a perk entry point which adds an additional option when a smelter is activated. It is set to run immediately so as to not pop up a menu box. The perk causes items stored in a particular container to transfer to the player for use at the smelter. Works well with any smelter with the CraftingSmelter keyword that the player actively clicks on. However, it does not work with a smelter in an inaccessible cell that is accessed via spell.

 

I cannot edit the spell, it is from another mod. Anyone know of any other way to get the perk to function when the smelter is not in the loaded cell?

 

I do have an alternative method for transferring the items (hot key toggle) but it fully replaces the perk. I am looking for a way to get it working with the perk method.

 

EDIT:

Answering my own question.

 

Use the event OnSpellCast within the player alias script.

Use GetFormFromFile to obtain the spell from the other mod.

Compare the spell cast to the spell from the other mod.

If matching transfer the items.

Recipes will still be grey instead of white but the items will show in white underneath the item card on the right hand side.

Edited by IsharaMeradin
Link to comment
Share on other sites

Is there any variable that is permanent? I want to memorise a value inside a variable that can linger in another event, and use it to change other variables, what can I use?


Let me explain.


Health = 200/300

Magicka = 150/400


Interchange values.


Health = 150/150

Magicka = 200/200


I want a variable that can memorise the base actor value so I can revert to these values again


Health = 150/300

Magicka = 200/400

Edited by Kerberus14
Link to comment
Share on other sites

Is there a way to add collision detection to an object?

 

I have rope slung between posts to act as a barricade/fence, but you can just walk right through the rope.

You could put a collision marker where the rope is which would probably do the trick.

Link to comment
Share on other sites

int numitems=PlayerRef.GetNumItems()

int index=0

while index<numitems

if PlayerRef.GetAt(index) == ArmorMaterialIron

;do something

endif

index=index+1

endwhile


C:\Users\Chevalie12\Desktop\The Elder Scrolls V Skyrim\Data\Scripts\Source\MeltDown.psc(53,13): GetAt is not a function or does not exist


What's the problem?

Link to comment
Share on other sites

 

int numitems=PlayerRef.GetNumItems()
int index=0
while index<numitems
if PlayerRef.GetAt(index) == ArmorMaterialIron
;do something
endif
index=index+1
endwhile
C:\Users\Chevalie12\Desktop\The Elder Scrolls V Skyrim\Data\Scripts\Source\MeltDown.psc(53,13): GetAt is not a function or does not exist
What's the problem?

 

Sorry, I had formlists on the brain. Replace GetAt with GetNthForm

Also, I don't think you can compare an item to a keyword. You might need to use HasKeyword.

Edited by IsharaMeradin
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...