Jump to content

CK/Papyrus: Spawn item at spell target?


kromey

Recommended Posts

To get my feet wet with the CK and with Papyrus before diving head first into my big project, I decided to create a few simple Conjuration spells.

 

At least, I thought they'd be simple.

 

Right now I am trying to create a spell that summons an object (in this case, a campfire) where the caster is pointing, similar to how creatures are summoned. I get that the object needs to already exist in the world (i.e. there needs to be a reference), and I'll be creating a QASmoke-like cell to hold it; I can then use the SetPosition() or MoveTo() methods to place it where the caster targets the spell.

 

Only problem is, I can't seem to figure out how to tell where the caster targets the spell! The target references only appear to work when the target is an actor or a specific reference (e.g. casting the spell on an object), but I need the spell to work when the caster targets a piece of the landscape.

 

I tried looking up the rune spells to see how those fancy glowing runes are created at the spell's location, but they didn't make any sense to me -- they're just "value modifier" effects, and for the life of me I can't see anywhere that the glowy runes are actually created.

 

Can anyone point me in the right direction for how to script this? I am, despite current appearances, a competent programmer, so I don't need a full hand-holding, just a nudge in the right direction. I could have my spell/effect set up completely wrong, too (the spell simply calls the one magic effect, which is set up as a script effect with my new script (currently with just some debugging statements in it)), so any advice on setting that up properly would be greatly appreciated as well.

Link to comment
Share on other sites

Best I can figure, you need to have your projectile create an explosion on impact. For your explosion effect, have it place the desired object using the "placed object" field of your explosion object. Note that this is entirely speculation, as I haven't yet tried it myself, haha.

 

As for the rune decals, that's done with the impact data and impact data sets.

 

Hope that helps!

Link to comment
Share on other sites

Hm, I hadn't thought to use an explosion. Because, well, there isn't one, really. But that doesn't mean I can't use that if I can script the "explosion" to just place the item I want spawned. Looks like I'll have to tweak the spell to use a projectile (it doesn't currently, because it was originally cloned from the Conjure Familiar spell, which also doesn't use a projectile), but that's easy enough to do, and I could just clone the spectral arrow's projectile to get a consistent look. Actually, looks like I could check the "hitscan" box on the projectile to not have any visible projectile anyway.

 

Thanks for the idea, I'll tinker with it when I get home, maybe finally get something working!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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