How can you reference a marker you place by spell?

Post » Sat Nov 17, 2012 5:34 pm

I'm trying to create a spell that will place a marker at a target location and then in another script when it detects a marker has been placed to teleport the actor the script is attached to to the location of the new marker placed by the spell.

However I do not know how to set the property for the marker inside the creation kit because it is a marker that does not exist inside the creation kit, it will only exist when the player casts the spell.

Is there a way to reference a marker that you would place in the game in this way?

Or am I going to have to create Aliases for the actors I want to move and put a script on the marker to move all said aliases to the markers location when it is initialized? IF that is even possible.. I haven't really done much work or any actually with any type of Alias, so that's just a theory I have..

Ultimately it would be awesome if someone could help me out and tell me how to reference to a marker placed by a spell like I'm talking about. IF it can be done..

Any help would be fantastic!

Thanks
User avatar
asako
 
Posts: 3296
Joined: Wed Oct 04, 2006 7:16 am

Post » Sat Nov 17, 2012 4:14 pm

Make a holding cell for the marker and use the MoveTo command. This will allow you to reference the marker as an object reference.
User avatar
Sierra Ritsuka
 
Posts: 3506
Joined: Mon Dec 11, 2006 7:56 am

Post » Sat Nov 17, 2012 8:54 am

Where would I put the MoveTo command? I would Move the Marker to the location hit by the spell? which I'm not exactly sure how to do

Unless I could perhaps put a script on the marker placed by the spell and

OnInit()	OldMarker.MoveTo(Self)Utility.Wait(3)Self.Delete


Something like that perhaps?
User avatar
Alexander Horton
 
Posts: 3318
Joined: Thu Oct 11, 2007 9:19 pm

Post » Sat Nov 17, 2012 12:19 pm

Hmmm That didn't work.. Actually I put in a Debug Messagebox to tell me that the Marker placed by the spell was initialized but never got that message..

So instead of placing a marker with the explosion I tried placing a ring with the script on it because I thought perhaps the marker was never going to OnInit because it wasn't loading any 3D model.. However After changing the Explosion to place a custom ring as object I still got no message.. And in fact when I cast the spell and look at the area it hits I do not see any Ring either..

So is the whole "Placed Object" part of Explosions not working? I'm using an explosion with FXEmptyObject.Nif and Force 0, Damage 0, Radius 1 and IS Radius 60

Have I done something wrong there with that?
User avatar
Marquis T
 
Posts: 3425
Joined: Fri Aug 31, 2007 4:39 pm

Post » Sat Nov 17, 2012 9:25 am

I have used Explosions with the ''Place Object'' box checked and placing scripted activators using FXEmptyObject.nif quite a lot and it did work for me... Are you also sure you actually made your spell cause that explosion? Generally a spell points to a projectile, and that projectile has an explosion assigned to it.

If you go with this route however, you should also make sure that you have some way to clean up again, otherwise extensive use of the spell will bloat your saved games. What I do is after everything is initialized I do

RegisterForSingleUpdateGameTime(24)

so I receive an update after 24 in game hours, and then I have the following event:

Event OnUpdateGameTime()If(self.IsNearPlayer())    RegisterForSingleUpdateGameTime(24)    returnElse        self.Disable()    self.Delete()EndIfEndEvent
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm


Return to V - Skyrim