Object reference to a spell projectile

Post » Mon Jun 18, 2012 7:57 pm

This is for Redwood Elf, primarily, and others who will want the same. I fly out to work tomorrow, away from my computer, Skyrim, and the CK for a week. I won't get time to test it, but the concept appears to be solid.

Problem: We need a spell projectile that can be referenced as an http://www.creationkit.com/ObjectReference_Script.

Answer: We can't get a reference to a projectile or anything we can attach to one, so we create our own. Here's how I think we can do it.

We have http://www.creationkit.com/GetPlayer_-_Game. We can get the http://www.creationkit.com/GetAngleZ_-_ObjectReference and the http://www.creationkit.com/GetAngleX_-_ObjectReference. We can predetermine a distance to work over. With a bit of math, we can determine a destination location in x, y, z co-ordinates.

One could then use a dummy spell. A concentration spell that applies an effect to the player would work. The players location could be locked for the duration using http://www.creationkit.com/DisablePlayerControls_-_Game to assist with line of sight. This might be considered a reasonable trade-off for the power of a teleport there spell.

An ObjectReference object would then be spawned at or moved to the player. This object needs to look like a projectile. There might be original assets we can use, or someone might create one. Using http://www.creationkit.com/TranslateTo_-_ObjectReference we feed in our pre-determined destination co-ordinates and speed. If I'm not mistaken, translate simply means move to. There's a whole load of translation function available. It can be stopped at any time using http://www.creationkit.com/StopTranslation_-_ObjectReference, and a check can be done with http://www.creationkit.com/OnLostLOS_-_Form to see if it disappeared from view and http://www.creationkit.com/OnTranslationComplete_-_ObjectReference to see if it reached the destination we gave it. If it disappears from view then there's design choices to be made. Kill it or back track?

You should (fingers crossed), now have an ObjectReference object that acts and looks like a projectile, cast from a magic spell.

Edit:

The projectile object could also be made an actor (like a bird maybe) with a second object place where the player was standing when the spell was cast. This might enable line of sight checks ( to determine when the projectile disappears below land or into a model ) and still allow the player to move around. ie ... Fire and forget.
User avatar
Rudy Paint fingers
 
Posts: 3416
Joined: Sun Nov 11, 2007 1:52 am

Post » Mon Jun 18, 2012 1:54 pm

Locking the player in place for the entire duration could be...very bad (what if you fired it into the sky? You would be locked in place forever). Once the start location, direction, etc have been determined, the thing should be fire-and-forget style.

I haven't looked much into collision yet...without knowing how to do that, it would be hard to stop the projectile when it strikes a surface...here's a compromise...make an effect with an invisible light projectile, have it trigger an invisible explosion when it strikes, dropping an invisible object. make the projectile insanely fast. When the spell is cast, the invisible projectile drops it's object, and we use that to get the target coordinates. You would have to build a wait function in to make sure the object has been spawned. You now have a start point and an end point.

I'll have to play with TranslateTo a bit to find the right speed for the Custom projectile, but this sounds like it will work. Thanks!
User avatar
Robyn Lena
 
Posts: 3338
Joined: Mon Jan 01, 2007 6:17 am

Post » Tue Jun 19, 2012 5:11 am

Is there a way to make a spell fire off two projectiles? If there is, just make one really fast so you can quickly get the player's approximate initial position and, from the impact position, the direction in which they were facing. From the speed of the other projectile, you can calculate where it should be.

If it's not there, it would probably be because it hit something, in which case it can use its own explosion to override the effect of the fast projectile, which would no longer be relevant.

Cipscis
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Mon Jun 18, 2012 6:50 pm

Is there a way to make a spell fire off two projectiles? If there is, just make one really fast so you can quickly get the player's approximate initial position and, from the impact position, the direction in which they were facing. From the speed of the other projectile, you can calculate where it should be.

If it's not there, it would probably be because it hit something, in which case it can use its own explosion to override the effect of the fast projectile, which would no longer be relevant.

Cipscis

Working on this...once it's working 100% I'll post the relevent scripts and instructions on how to do it.
User avatar
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Mon Jun 18, 2012 10:19 pm

Locking the player in place for the entire duration could be...very bad

Release the lock when you stop casting assuming it's a concentration spell. Don't lock if it's fire and forget.

Last post for a week. Enjoy.
User avatar
Sophie Miller
 
Posts: 3300
Joined: Sun Jun 18, 2006 12:35 am


Return to V - Skyrim