Jump to content

[LE] How to make SummonTargetFX appear higher above ground?


5133p39

Recommended Posts

I have a scripted conjuration spell that spawns things at certain place and certain height above ground.
Problem is, the visual effect for conjuration spells (see image below) is typically played at the target location (resp. where the game snaps it to the navmesh), or on an actor.
I need to be able to place this effect via papyrus wherever i want, including any height.

I tried using Explosion, which i still couldn't move as i wanted, but supposedly i should be alowed to set vertical offset from the ground - that doesn't work though.
Maybe the vertical offset is not applied to the "Placed Object" which i had to set to the SummonTargetFX to make it appear (setting "Art file" to the summon effect NIF file results in no effect being shown).

What would be the cleanest and still convenient way to do this?
I am thinking about using the effect NIF as a model for some static object, but staticts can't be moved unless i am mistaken, so it would have to be a furniture? activator? ...what else?
I want to choose something that would be the most efficient, the simplest possible type of object - what should it be?

Link to comment
Share on other sites

Store the reference returned from PlaceAtMe to a variable, then call MoveTo on it that reference, and set the ZOffset to whatever you want.

I dont understand. Reference to what? What am i supposed to PlaceAtMe()?

By default, there is no reference to the conjuration/summoning visual effect - you cannot cast the spell and then somehow get reference to the visual effect and move it somewhere else.

So, how do you propose i implement a "placeable/movable SummonTargetFX visual effect"?

Edited by 5133p39
Link to comment
Share on other sites

PlaceAtMe returns the ObjectReference, in this case the SummonFX. You can store it to a variable. If you don't know how to do that, or what that even means, then..don't know what to say, but this is an (untested) example of what I'm talking about:

ObjectReference myFX = Player.PlaceAtMe(SummonFX)
myFX.MoveTo(Player, 0, 0, zoffset)

With zoffset being whatever you want..

Edited by Rasikko
Link to comment
Share on other sites

 

I dont understand. Reference to what? What am i supposed to PlaceAtMe()?

Possibly, like that. A projectile has a fake explosion, which only spawns a marker-type PlacedObject on impact, the Marker has OnLoad event, whose code moves itself to a specific offset point, e.g. Self.MoveTo(Self, offsetX, offsetY, offsetZ), then does PlaceAtMe() actual Explosion (or anything else), and Self.Delete().

PS. Or SetPosition(). Take care though "OnLoad Event Behaviour" https://www.creationkit.com/index.php?title=Talk:SetPosition_-_ObjectReference .

Edited by hereami
Link to comment
Share on other sites

PlaceAtMe returns the ObjectReference, in this case the SummonFX. You can store it to a variable. If you don't know how to do that, or what that even means, then..don't know what to say, but this is an (untested) example of what I'm talking about:

ObjectReference myFX = Player.PlaceAtMe(SummonFX)
myFX.MoveTo(Player, 0, 0, zoffset)

With zoffset being whatever you want..

 

 

I dont understand. Reference to what? What am i supposed to PlaceAtMe()?

Possibly, like that. A projectile has a fake explosion, which only spawns a marker-type PlacedObject on impact, the Marker has OnLoad event, whose code moves itself to a specific offset point, e.g. Self.MoveTo(Self, offsetX, offsetY, offsetZ), then does PlaceAtMe() actual Explosion (or anything else), and Self.Delete().

PS. Or SetPosition(). Take care though "OnLoad Event Behaviour" https://www.creationkit.com/index.php?title=Talk:SetPosition_-_ObjectReference .

 

Yes, i know all that, what i do not understand is where do you want me to get the "SummonFX" object that i can place using PlaceAtME() - i mean if i had such object already, i wouldn't be here asking my question - which i think you misunderstood.

I am not asking what functions can i use to move references - i can read all about that in the Papyrus language reference on CK wiki.

I am asking what would be the best way to create a fake summon effect that i can move via Papyrus functions to wherever i please (including height).

 

So, what would be the best way to create it?

Should i use activator or furniture (both seems like an overkill), or some static object (nope, 'cause that can't be moved), or maybe movable static (probably not, because i dont think i can make it stay where i place it - because havok), or actor (nope, that is REALLY an overkill, too expensive), or an explosion (nope, can't set it's height above ground), or what?

Edited by 5133p39
Link to comment
Share on other sites

Nevermind, problem solved.

I was having a long dumb moment, didn't even try to spawn the "art object" form directly - for some reason i convinced myself it wont work, before i even tried.
Now it is obvious that this is exactly what both posters above were trying to tell me :-D
So, for example, if i'd wanted to place the summoning visual effect 100 units above player's head:

form _artObject = Game.GetFormFromFile(0x3f811, "Skyrim.esm")
objectReference _summonFx = Game.GetPlayer().PlaceAtMe(_artObject)
_summonFx.MoveTo(_summonFx, 0.0, 0.0, 100.0)

i am still a bit sad about not being able to use the Explosion, which would be super convenient, because you can assign a sound to it, the object automatically despawns, you can make it apply image modifiers, etc., saddly, adjusting the height where the "explosion" appears is not really working (or at least not when using the SummonTargetFX art object).

Edited by 5133p39
Link to comment
Share on other sites

 

i am still a bit sad about not being able to use the Explosion

? In the last code above append _summonFx.PlaceAtMe(myExplosion) - assuming _summonFx is just an auxilliary marker (IsMarker), not something visible. Try to specify myExplosion's model as SummonTargetFX's NIF. Don't know, why STAT wouldn't move, sure about it? All markers are Statics and moved all around the game (well, F4 at least...).

 

PS. Btw, placing a static nif inside a MSTT won't make the object floating, nif defines the physics.

Edited by hereami
Link to comment
Share on other sites

i am still a bit sad about not being able to use the Explosion

? In the last code above append _summonFx.PlaceAtMe(myExplosion) - assuming _summonFx is just an auxilliary marker (IsMarker), not something visible. Try to specify myExplosion's model as SummonTargetFX's NIF. Don't know, why STAT wouldn't move, sure about it? All markers are Statics and moved all around the game (well, F4 at least...).

Sorry, i didn't read it thoroughly.

This solution works only partially - yes, the explosion will be placed at the marker, but it wont be attached to it, so moving the marker wont move the Explosion with it.

There are no means to move an Explosion (if you try MoveTo() on it, you'll get errors).

 

I dont know where i got the thing about not being able to move STAT, maybe it was the precombines in Fallout 4 and i mixed things up.

In any case, STAT is a no go, because i want to attach a script to the object in CK, and you cannot attach scripts to STATs in CK.

So, the original question (what would be the best type of object for this purpose?) still stands.

Unless i keep forgetting something, from all objects whose references can be moved via Papyrus (once they get placed in the world), you can only attach scripts (in CK) to base objects (eg. not placed references) of type actor, activator, armor, book, container, door, flora, furniture, hazard (maybe via assigned spell?), ingredient, key, light (can it be moved?), miscitem, weapon.

 

So, if i want to spawn ONE movable object, capable of playing visual effect and sound, and which can have a script attached to it.

What would be the best type?

I am now thinking about Light

- you can set its model to the visual effect

- you can set a sound that will automatically play on it

- you can attach a script

- but can it be moved? not sure, needs to be tested

Another question is, whether abusing Light for this purpose wouldn't be actually more expensive than using something else (but what, what would you recommend?).

I realize it may look like overthinking, or overoptimizing, but that doesn't make the question invalid.

If there is some "best way" of doing this, i want to know which one it is.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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