Tracking a Spell Projectile

Post » Thu Apr 29, 2010 8:00 pm

I was wondering if it is possible to do the following:

1. Detect when the Player Casts a spell (OnControlDown)
2. A Certain Spell, that is (GetPlayerSpell)
3. Get the co-ordinates of the projectile as it travels (no idea)
4. Detect when the projectile is dead (no idea)
5. Move the Player to the last known co-ordinates (SetPos)

Basically what I want to do is make a Nightcrawler-style Spell, with the Player being able to instantly teleport to any location they can see.

I'd be grateful for any help with this :)
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Thu Apr 29, 2010 8:47 pm

I believe such a teleportation spell is available in fearsome magicka :) Unless you really want to make it yourself or are uncapable using that mod of course.
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Thu Apr 29, 2010 4:50 pm

Unfortunately, I plan it for another Mod which I will (hopefully) be releasing at some point in the future-- however, if I get a chance I'll definitely take a look at FM :)

Looking at the OBSE documentation, I am wondering if something like this will work?

Short ShotFiredRef PlayShotShort ShotXShort ShotYShort ShotZShort OldXShort OldYShort OldZIf ( OnControlDown 7 )	Set ShotFired to 1EndIfIf ( ShotFired == 1 )	Set PlayShot to Player.GetProjectile	Set ShotX to PlayShot.GetPos X	Set ShotY to PlayShot.GetPos Y	Set ShotZ to PlayShot.GetPos Z	If ( OldX != ShotX ) && ( OldY != ShotY ) && ( OldZ != ShotY )		Set OldX to ShotX		Set OldY to ShotY		Set OldZ to ShotZ	ElseIf ( ShotX == 0) && ( ShotY == 0 ) && ( ShotZ == 0 )		Ste ShotFired to 0		Player.SetPos X ShotX		Player.SetPos Y ShotY		Player.SetPos Z ShotZ	EndIfEndIf					


It's based on the assumption that when the Porjectile hits, it deletes itself and no-longer returns a position.
User avatar
Kellymarie Heppell
 
Posts: 3456
Joined: Mon Jul 24, 2006 4:37 am

Post » Thu Apr 29, 2010 7:39 am

I think the game will put you down on the pathgrid despite where your projectile hits. Like, if you shoot the ceiling, it'll move you to the floor directly underneath the spot you shot. I also don't know how to get around this.

Also, Set is misspelled on the sixth line from the end.

You can also try isformvalid to check if the projectile is gone. Not a big deal though.
User avatar
aisha jamil
 
Posts: 3436
Joined: Sun Jul 02, 2006 11:54 am


Return to IV - Oblivion