Jump to content

[LE] Turning Console Commands into spells?


Recommended Posts

Hey everyone, long-time mod-user, relatively new modder. Hopefully someone here can help me figure out how to fix my mod.

 

I'm trying to turn console commands (PC) into spells. I know that they exist as Papyrus functions (i.e, resurrect is Actor.Resurrect), but that doesn't help me much, and I can't figure out how to call those functions in CK to make/modify a spell.

 

I have modified a lot of spells, mostly by changing damage types, area, etc, but I can't figure out where to call these functions or how to find them.

 

I have a mod that I downloaded called "Resurrect" which seems to call the console command, but the script doesn't give me any insight.

 

Does anyone know how I might turn the commands into spells, and how I might call Papyrus functions into Creation Kit?

 

Edit: I am aware of the CK tutorials. They don't help me since they refer to information which does not apply to my version of CK. They tell me to create my own script, but mine doesn't allow for that, as it gives me errors that the scripts (which I am creating) don't exist (of course they don't, I'm creating them).

Link to comment
Share on other sites

you just attach a script to the magic effect that the spell applies, and put your functions in the OnEffectStart event in the script

 

Event OnEffectStart(Actor akTarget, Actor akCaster)
; do whatever
EndEvent

 

and fwiw you don't actually need to use the CK to create the script itself. I don't. I never do. I just create a .psc file in the scripts folder manually. As long as you compile it it'll work

Edited by rkkn
Link to comment
Share on other sites

The way you described it just doesn't make any sense to me.

 

When you say "add a script to the magic effect", are you referring to the specific MGEF or the actor.resurrect function?

 

Where you put ActorAKtarget, is that where I'm supposed to put my function or do I use those properties?

 

What kind of stuff should I be putting in the middle section? I know how to call the function, but this event, by itself, won't function.

 

This is what I have:

Scriptname revivalscript extends activemagiceffect  
 Spell property resurrect Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
actor.resurrect()
EndEvent

and this is what it gives me. Any change to this generates either a "too many actors called to function" or "the type name actor cannot be used as a property"

Starting 1 compile threads for 1 files...
Compiling "revivalscript"...
C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\revivalscript.psc(4,6): cannot call the member function resurrect alone or on a type, must call it on a variable
No output generated for revivalscript, compilation failed.
 
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on revivalscript

Edit: I got it working with some help from a weapon modding tutorial. The correct script is

Scriptname resurrection extends activemagiceffect  
Event OnEffectStart(Actor AkTarget, Actor akCaster)
akTarget.resurrect()
EndEvent

Or at least that's a correct script. This one requires it to hit an actor or it fizzles out, so it's useless for AoE revivals.

 

This also works for kill spells.

Scriptname resurrection extends activemagiceffect  
Event OnEffectStart(Actor AkTarget, Actor akCaster)
akTarget.kill()
EndEvent

Same issue here, it needs an actor so it can't be used as an AoE spell like a fire spell would be.

 

If you know how I could adjust those to make either one work for AoE, that would be extremely helpful.

 

Additionally, I noticed that while akTarget.resurrect() works, akTarget.recycleactor() does not. Recycleactor is not a native function, so how does the console know it, and can I make it into a function?

Edited by darkwolf0218
Link to comment
Share on other sites

If you want it to be AoE and work without hitting an actor, you need to set the Delivery on both the spell and magic effect to Target Location. There's also an Area property on the spell to set for the size of the AoE.

 

That will work most of the time, but I find that it can still be a little finicky and fizzle for unknown reasons.

If you want it to work a little more reliably (like Fireball) then give the magic effect a projectile and set the delivery to Aimed.

 

 

Additionally, I noticed that while akTarget.resurrect() works, akTarget.recycleactor() does not. Recycleactor is not a native function, so how does the console know it, and can I make it into a function?

A lot of console commands don't have native Papyrus functions. However there's a utility for that: https://www.nexusmods.com/skyrim/mods/66257

Link to comment
Share on other sites

If you want it to work a little more reliably (like Fireball) then give the magic effect a projectile and set the delivery to Aimed.

 

Fireball is exactly what I'm looking for. My inspiration for these was the Catapult Projectile Spell that came, oddly enough, with the Fishing Update. I made frost and shock versions of that, as well as (accidentially by using the wrong projectile) Rune attacks that leave fire/frost/shock runes floating for NPC's to stumble in to and explode.

 

Aimed is what I use, but it doesn't work. It needs an actor. Target Location also needs an actor. Target Actor also needs an actor, but that one just won't fire without one. Target Location fires a projectile that triggers no effects beyond FX.

 

A lot of console commands don't have native Papyrus functions. However there's a utility for that: https://www.nexusmods.com/skyrim/mods/66257

Of course there is. I swear, modders have put 100x as much effort into this game as Bethesda ever did, including fixing all the "you fell through the ground" and "that enemy started spinning through the air and became Elon Musk's new test vessel to Mars" issues.

 

Edit: sadly this doesn't work for SE or AE. It's for Oldrim. Trying to use it gives the error message that LE plugins cannot be used with AE. If I ignore that, the game simply doesn't load at all. It crashes instantly, which is typical of LE mods on AE.

Got it to not break the game, but it doesn't add any papyrus functions. It just gives some console.util thing which CK can't read.

It can take Console.UtilExecutecommand("recycleactor), but AkTarget can't be used anymore, meaning it can't execute the function.

Link to comment
Share on other sites

I've tried for a while now and still failed; either the utility isn't up to the task or I'm just not able to get it to function correctly.

It can take Console.UtilExecutecommand("recycleactor), but AkTarget can't be used anymore, meaning it can't execute the function.

 

Additionally, those spells that use AkTarget don't work without a target; there's got to be another function there, but I can't find it.

Link to comment
Share on other sites

ConsoleUtil.SetSelectedReference(akTarget)

ConsoleUtil.ExecuteCommand("recycleactor")

Thank you. I was getting maddeningly close with some other spells that I had either made or downloaded, such as Atom Bomb which has a push spell, but that one had a native function. I got the spell to compile, but the effect was still empty.

 

I know just enough Java, C++, and Pascal (I know it's bascially obsolete but it's what the coding teacher used as an intro before the other two) to be dangerous, but not enough to intuit my way through problems in Papyrus.

 

Edit: Unfortunately, this version still returns a valid spell with no effect. The spell works fine but doesn't trigger the recycleactor effect. It just activates the fx, which for mine are dragon armor fx.

Scriptname recycleactor extends activemagiceffect  
 
Event OnEffectStart(Actor AkTarget, Actor akCaster)
ConsoleUtil.SetSelectedReference(akTarget)
ConsoleUtil.ExecuteCommand("recycleactor")
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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