No valid example for "FindClosestReferenceOfTypeFromRef&

Post » Mon Jun 18, 2012 2:09 pm

OK, after 4 days of wrestling this octopus, I'm in the home stretch of getting this to work...however...

The final barriers tohttp://i591.photobucket.com/albums/ss358/RedwoodElf/CKTeleport02.jpg are:

1: The reference variable "TeleportHere" doesn't keep it's value between events. I can get it to come up under certain circumstances (Hit an Actor with the first spell) but the value is apparently erased by the time the second spell goes off. Variables are supposed to be places to store data, but apparently not in Papyrus. This means I absolutely MUST get FindClosestReferenceOfTypeFromRef to work, since there is no other way I can think of to get a reference to the projectile or light created by the first spell, since I can't just save it.

2: I can't get FindClosestReferenceOfTypeFromRef to work at all. I know what I have to do is make a dummy object of the type I'm searching for and send it far, far away before calling this function, but I can't get PlaceAtMe to create said objects for this purpose...I know I've heard that the EditorID is NOT the actual reference you need to use to have a script create an item of a new type you've created, but I still don't know what I DO need to use to create said dummy item.

The script is here (See the above link for a screenshot of the magic effects it's in, and the two objects I'm trying to search for, highlighted in the object pane) - See comments in the code for currently observed behavior.

Spoiler
Scriptname PlayerTeleportScript extends ActiveMagicEffect  {A script to teleport the player to a destination node.}import gameimport utilityObjectReference playerObjectReference TeleportHere ; A variable that cannot store a value. Every time the Event is instanced, it appears to come back "None"Event OnEffectStart(Actor Target, Actor Caster)	    if Target == Caster; This case means it was called from the self cast teleport effect, not the spell effect that fires the projectile Debug.MessageBox("Teleport Node entering Teleport Self Effect: " + TeleportHere); Always returns "None"			    player = (game.getPlayer() as ObjectReference)			    if TeleportHere					    Utility.Wait(0.5)					    player.MoveTo(TeleportHere)     			    else ; Try to find the TeleportSpellProjectile or light.					    TeleportHere = (FindClosestReferenceOfTypeFromRef(TeleportSpellProjectile,Game.Getplayer(),10000000) as ObjectReference)					    if !TeleportHere							    TeleportHere = (FindClosestReferenceOfTypeFromRef(MagicLightTeleportSpell,Game.Getplayer(),10000000) as ObjectReference)					    endif					    if !TeleportHere							    TeleportHere = (FindClosestReferenceOfTypeFromRef(MagicLightTeleportSpell,Game.Getplayer(),10000000) as ObjectReference)					    endif					    if !TeleportHere							    Debug.MessageBox("Unable to locate any teleport node by any means.")					    else							    player.MoveTo(TeleportHere)							    Debug.MessageBox("Node Assigned to:" + TeleportHere)					    endif			    endif	    else ; Called from the missile launching effect, when it strikes an Actor. Debug.MessageBox("Old Node: " + TeleportHere) ; Always comes back "None"			    TeleportHere = (Target  as ObjectReference) Debug.MessageBox("Node Assigned: " + TeleportHere) ; This shows a value...but it is lost by the time the next event comes around.	    endifEndEventLight Property MagicLightTeleportSpell auto ; Doesn't actually allow use of the type to create an item instance. Need to know how.Projectile Property TeleportSpellProjectile autoSpell Property TeleportLaunch AutoSpell Property TeleportMove Auto

Could someone please tell me what's going wrong? I'm a C++/Java programmer, so I am pretty familiar with how variables are supposed to work, and this isn't it.

I could get around the variable problem, if only I could figure out how to instance a Light of the type the spell uses, move it a long way away, then use the finding function to find the closest one. Or the projectile type...either should work if the function works as advertized.
User avatar
Kara Payne
 
Posts: 3415
Joined: Thu Oct 26, 2006 12:47 am

Post » Mon Jun 18, 2012 10:12 pm

1. When the spell goes off, all the variables are reset indeed, as when a program ends. The workaround I think is used, is to save variables you need in a quest and call them in your script.

2. I cannot make that function work neither. I have managed to get working FindClosestReferenceOfAnyTypeInListFromRef but when I try to pass a Form to FindClosestReferenceOfTypeFromRef I always get the runtime error "error: None or invalid form type as Base object for FindClosestReferenceOfType" Do you get it passing a projectile too?
What it works for me using a FormList is this ( note that I use a PlaceAtMe there and it's working too )

scriptName ShanaAimedOpenTestScript extends ActiveMagicEffect{Scripted magic effect Placing and activator and then removing it.}import utilityimport game;======================================================================================;;  PROPERTIES  /;=============/activator property FXEmptyActivator auto{The name of the placed Activator that the spell will come from. (REQUIRED!)}FormList property ShanaThingsOpenable auto;======================================================================================;;  VARIABLES   /;=============/ObjectReference closestDoorobjectReference ActivatorReffloat RadiusToFindDoor = 1000.0;======================================================================================;;   EVENTS	 /;=============/Event OnInit()  Debug.Trace(" ShanaAimedOpenTestScript OnInit ")EndEventEvent OnEffectStart(Actor Target, Actor Caster)Debug.Trace(" ShanaAimedOpenTestScript OnEffectStart begins")ActivatorRef = Target.placeAtMe(FXEmptyActivator)Debug.Trace("After placeAtMe")if ( ActivatorRef != None)  Debug.Trace("Activator has been placed")Else  Debug.Trace("Activator has NOT been placed!")endifDebug.Trace(" Looking for doors...hopefully")closestDoor  = Game.FindClosestReferenceOfAnyTypeInListFromRef(ShanaThingsOpenable, ActivatorRef, RadiusToFindDoor )Debug.Trace(" ShanaAimedOpenTestScript : After FindClosestReferenceOfAnyTypeInListFromRef")if ( closestDoor == None)  Debug.Trace("There is no door near!")  Debug.Notification("There is no door near!")else  Debug.Trace("The closest door is: " + closestDoor)  if( closestDoor.isLocked() )   Debug.Trace("Opening door!!!")   Debug.Notification("Opening door!!!")   closestDoor.Lock(false)  else   Debug.Notification("The door is not closed!")   Debug.Trace("The door is not closed!")  endifendifDebug.Trace(" ShanaAimedOpenTestScript OnEffectStart ends")EndEventEvent OnEffectFinish(Actor Target, Actor Caster)if (ActivatorRef != none)  ActivatorRef.disable()  ActivatorRef.delete()endifEndEvent

My problem now is that the activator seems to be only placed when I hit an actor, so my other script for the Self spell version works wonders, but I dunno what to do with the aimed one...
User avatar
Cccurly
 
Posts: 3381
Joined: Mon Apr 09, 2007 8:18 pm

Post » Mon Jun 18, 2012 9:02 pm

1. When the spell goes off, all the variables are reset indeed, as when a program ends. The workaround I think is used, is to save variables you need in a quest and call them in your script.

2. I cannot make that function work neither. I have managed to get working FindClosestReferenceOfAnyTypeInListFromRef but when I try to pass a Form to FindClosestReferenceOfTypeFromRef I always get the runtime error "error: None or invalid form type as Base object for FindClosestReferenceOfType" Do you get it passing a projectile too?
What it works for me using a FormList is this ( note that I use a PlaceAtMe there and it's working too )

scriptName ShanaAimedOpenTestScript extends ActiveMagicEffect{Scripted magic effect Placing and activator and then removing it.}import utilityimport game;======================================================================================;;  PROPERTIES  /;=============/activator property FXEmptyActivator auto{The name of the placed Activator that the spell will come from. (REQUIRED!)}FormList property ShanaThingsOpenable auto;======================================================================================;;  VARIABLES   /;=============/ObjectReference closestDoorobjectReference ActivatorReffloat RadiusToFindDoor = 1000.0;======================================================================================;;   EVENTS	 /;=============/Event OnInit()  Debug.Trace(" ShanaAimedOpenTestScript OnInit ")EndEventEvent OnEffectStart(Actor Target, Actor Caster)Debug.Trace(" ShanaAimedOpenTestScript OnEffectStart begins")ActivatorRef = Target.placeAtMe(FXEmptyActivator)Debug.Trace("After placeAtMe")if ( ActivatorRef != None)  Debug.Trace("Activator has been placed")Else  Debug.Trace("Activator has NOT been placed!")endifDebug.Trace(" Looking for doors...hopefully")closestDoor  = Game.FindClosestReferenceOfAnyTypeInListFromRef(ShanaThingsOpenable, ActivatorRef, RadiusToFindDoor )Debug.Trace(" ShanaAimedOpenTestScript : After FindClosestReferenceOfAnyTypeInListFromRef")if ( closestDoor == None)  Debug.Trace("There is no door near!")  Debug.Notification("There is no door near!")else  Debug.Trace("The closest door is: " + closestDoor)  if( closestDoor.isLocked() )   Debug.Trace("Opening door!!!")   Debug.Notification("Opening door!!!")   closestDoor.Lock(false)  else   Debug.Notification("The door is not closed!")   Debug.Trace("The door is not closed!")  endifendifDebug.Trace(" ShanaAimedOpenTestScript OnEffectStart ends")EndEventEvent OnEffectFinish(Actor Target, Actor Caster)if (ActivatorRef != none)  ActivatorRef.disable()  ActivatorRef.delete()endifEndEvent

My problem now is that the activator seems to be only placed when I hit an actor, so my other script for the Self spell version works wonders, but I dunno what to do with the aimed one...

So how do you set values for the ThingsOpenable list, and how do you get it to keep it's value(s)? I can't even store a single reference, but you were able to get a list to keep it's values from one event to another?

(edit) Ah, I see, it's not a dynamically assigned list, but hard-defined in the editor. Won't work to store any values a script generates then...
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am

Post » Mon Jun 18, 2012 6:18 pm

example from what i used with my shadow step ability

It is unfinished code but you should get the general idea, it searches for a random combat targets and checks if we have Line of Sight

actor stepToObjectReference playeractor casterobjectReference casterRefEvent OnEffectStart(Actor akTarget, Actor akCaster)	player = game.getPlayer()	caster = akCaster	casterRef = (caster as ObjectReference)	Teleport()endEVENT

stepTo = caster.GetCombatTarget()if stepTo == none  while stepTo == NONE || !stepTo.IsInCombat() || stepTo.IsDead() || stepTo == game.GetPlayer() || stepTo == caster || i < MaxSearch   stepTo = FindRandomActorFromRef(casterRef, fSearchRadius)   if stepTo.getDistance(stepTo) > 500 || caster.hasLoS(stepTo) == TRUE	i = MaxSearch   endif   i += 1  endWhileEndIf

FindRandomActorFromRef & FindClosestReferenceOfTypeFromRef have different usages but you should get the general idea
User avatar
Toby Green
 
Posts: 3365
Joined: Sun May 27, 2007 5:27 pm

Post » Tue Jun 19, 2012 12:44 am

If I would have known THIS is what you were doing, I would have suggsted http://www.gamesas.com/topic/1347347-tutorial-get-the-position-of-a-spell-hit-for-a-script/page__hl__tutorial+get+location+spell__fromsearch__1to you a long time ago.
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Mon Jun 18, 2012 12:48 pm

If I would have known THIS is what you were doing, I would have suggsted http://www.gamesas.com/topic/1347347-tutorial-get-the-position-of-a-spell-hit-for-a-script/page__hl__tutorial+get+location+spell__fromsearch__1to you a long time ago.

I spotted the "Spawn object" thingie in explosions about 2 and a half days ago...problem is, I can't even figure out how to pass a reference from an object to an event on a spell. Heck, I can't even create a new object type and get PlaceAtMe to actually create one as a dummy object from which I can access the member functions of the object or use as the reference for the search functions!
(and even then, it would be the member functions of THAT object, not of the previously created one)

While the explosion could drop one, the second spell still has to find it (Since script variables are lost between calls), thus the need for getting the reference finding functions to work.

For example, let's say you wanted to make a series of "Delayed" spells, which you can plant around the cell with spell projectiles, then set off by casting a single "Trigger" spell that causes the dropped objects to explode (Cast an AOE blast of whatever damage type)

That "Trigger" spell has to be able to find all of the objects, set them off, and destroy them.
User avatar
Jade Muggeridge
 
Posts: 3439
Joined: Mon Nov 20, 2006 6:51 pm

Post » Mon Jun 18, 2012 7:28 pm

So how do you set values for the ThingsOpenable list, and how do you get it to keep it's value(s)? I can't even store a single reference, but you were able to get a list to keep it's values from one event to another?

(edit) Ah, I see, it's not a dynamically assigned list, but hard-defined in the editor. Won't work to store any values a script generates then...

Note that It is a list of forms, not a list of references, if you create a FormList and drag and drop your projectile in there, using FindClosestReferenceOfAnyTypeInListFromRef should work I think...

I spotted the "Spawn object" thingie in explosions about 2 and a half days ago...problem is, I can't even figure out how to pass a reference from an object to an event on a spell. Heck, I can't even create a new object type and get PlaceAtMe to actually create one as a dummy object from which I can access the member functions of the object or use as the reference for the search functions!
(and even then, it would be the member functions of THAT object, not of the previously created one)

While the explosion could drop one, the second spell still has to find it (Since script variables are lost between calls), thus the need for getting the reference finding functions to work.

For example, let's say you wanted to make a series of "Delayed" spells, which you can plant around the cell with spell projectiles, then set off by casting a single "Trigger" spell that causes the dropped objects to explode (Cast an AOE blast of whatever damage type)

That "Trigger" spell has to be able to find all of the objects, set them off, and destroy them.

I will try later and let you know, but I am sure that you can both things creating a dummy quest, adding the variables in there and changing them from wherever, the spell script, the object, etc...

Also after reading your last post, I have realized that maybe for what we want to do, we don't even need to do that. Maybe we could just spawn the item with the explosion thing and then write the rest of the needed code inside the object OnInit event. In your case, spawn the object with the explosion and then add a script inside the spawned object with something like:
player.moveto selfself.Delete

I will check in a couple of hours hehe :)
User avatar
Carys
 
Posts: 3369
Joined: Wed Aug 23, 2006 11:15 pm

Post » Mon Jun 18, 2012 12:43 pm

I spotted the "Spawn object" thingie in explosions about 2 and a half days ago...problem is, I can't even figure out how to pass a reference from an object to an event on a spell. Heck, I can't even create a new object type and get PlaceAtMe to actually create one as a dummy object from which I can access the member functions of the object or use as the reference for the search functions!
(and even then, it would be the member functions of THAT object, not of the previously created one)

While the explosion could drop one, the second spell still has to find it (Since script variables are lost between calls), thus the need for getting the reference finding functions to work.

For example, let's say you wanted to make a series of "Delayed" spells, which you can plant around the cell with spell projectiles, then set off by casting a single "Trigger" spell that causes the dropped objects to explode (Cast an AOE blast of whatever damage type)

That "Trigger" spell has to be able to find all of the objects, set them off, and destroy them.

Is what I was suggesting with that video, Is do all your spell related [censored] on the OBJECT and not the spell. You can set up the same properties as the spell and it will work (Hypothetically) the same. You just have to change the event.

EDIT:
Ok. Simple. Use the same spell, with the explosion effect set to Alt. Triggered (Which means proximity if you set it up correctly), On spawn of that itme, Spawn other multiple explosions, or a secondary explosion... DONE :D

If you want something more of a Cluster bomb, have the first one trigger, spawing sets of SECOND explsions with the alternate triggered set up.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Mon Jun 18, 2012 10:59 am

Note that It is a list of forms, not a list of references, if you create a FormList and drag and drop your projectile in there, using FindClosestReferenceOfAnyTypeInListFromRef should work I think...



I will try later and let you know, but I am sure that you can both things creating a dummy quest, adding the variables in there and changing them from wherever, the spell script, the object, etc...

Also after reading your last post, I have realized that maybe for what we want to do, we don't even need to do that. Maybe we could just spawn the item with the explosion thing and then write the rest of the needed code inside the object OnInit event. In your case, spawn the object with the explosion and then add a script inside the spawned object with something like:
player.moveto selfself.Delete

I will check in a couple of hours hehe :smile:

That would be too easy :tongue: but the idea is to delay the teleport until you cast a second spell, and I want to have the possibility of teleporting to the projectile while it's still in transit and hasn't hit anything yet.

and the "Teleport Node" is, in fact, going to have a number of spells that will use it as a focus...so it's more of a Spell Focus spell...kind of like a rune that sticks around and can be used to do things by remote control. Teleport is just the first one I want to get working, since that seems to be the hardest. Once I can do that, the others should be a snap.

Unfortunately, I don't see any way this can be done, since Projectiles aren't based on ObjectReferences (and that's REALLY weird, because I see arrows fall on the ground all the time.)
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Mon Jun 18, 2012 5:23 pm

Unfortunately, I don't see any way this can be done, since Projectiles aren't based on ObjectReferences (and that's REALLY weird, because I see arrows fall on the ground all the time.)

I haven't tested this yet, but are you aware that projectiles can have lights, and lights can have scripts. ObjectReference scripts ...

:nod:

And you can specify an explosion in the projectile properties itself. Make it place a copy of your light. One light to carry there, one light to leave behind. Teleport arrows for the sneaky types? Teleport spells for the mages?
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Mon Jun 18, 2012 8:40 pm

I haven't tested this yet, but are you aware that projectiles can have lights, and lights can have scripts. ObjectReference scripts ...

:nod:

And you can specify an explosion in the projectile properties itself. Make it place a copy of your light. One light to carry there, one light to leave behind. Teleport arrows for the sneaky types? Teleport spells for the mages?

Would an ObjectReference Script attached to a non-objectreference object allow things like player.moveto though? would it, in effect, work like the "real Programming Language" keyword Implements, and make the Light inherit the functions of an ObjectReference?
User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Mon Jun 18, 2012 1:44 pm

http://www.creationkit.com/Light_Script extends http://www.creationkit.com/Form_Script, not http://www.creationkit.com/ObjectReference_Script, so it won't inherit functions like http://www.creationkit.com/PlaceAtMe_-_ObjectReference.

So long as you don't need to call a function that belongs to ObjectReference on a Light, that shouldn't be a problem. You can still call them from a script that extends Light, so long as you're calling them on an ObjectReference or a type derived from it, like http://www.creationkit.com/Actor_Script.

Cipscis

EDIT:

My latest tutorial, http://www.cipscis.com/skyrim/tutorials/externalaccess.aspx, covers this a bit.

Cipscis
User avatar
Setal Vara
 
Posts: 3390
Joined: Thu Nov 16, 2006 1:24 pm

Post » Mon Jun 18, 2012 11:39 am

http://www.creationkit.com/Light_Script extends http://www.creationkit.com/Form_Script, not http://www.creationkit.com/ObjectReference_Script, so it won't inherit functions like http://www.creationkit.com/PlaceAtMe_-_ObjectReference.

So long as you don't need to call a function that belongs to ObjectReference on a Light, that shouldn't be a problem. You can still call them from a script that extends Light, so long as you're calling them on an ObjectReference or a type derived from it, like http://www.creationkit.com/Actor_Script.

Cipscis

EDIT:

My latest tutorial, http://www.cipscis.com/skyrim/tutorials/externalaccess.aspx, covers this a bit.

Cipscis

I know that first part...but that other guy was suggesting that adding an ObjectReference script to a Light object would let you do so, so I was speculating that it would make it work like "implements" in other languages, you know, where you define the inheritence as "Extends X, Implements Y" (where X is the base class, and Y is a class interface containing additional functions that make it doubly-inherit effectively from two different classes of object)

So how would YOU move the player to the position of an object that extends Light? I haven't even figured out how to get a reference to a light object yet (Even one the player created with a spell), let alone determine it's X,Y, and Z coordinates (which it clearly has, since it is drawn at a very specific position as it moves) I haven't been able to do that with either a Light (which can have scripts attached) or Projectiles (which can't)
User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Mon Jun 18, 2012 10:32 pm

Yeah, I was just wondering how a script attached to a Light would work, in that respect. I would have expected Light to extend ObjectReference - as you said they clearly function similarly to references - but it doesn't seem to work that way.

It might not be possible, currently, to get that sort of information out of a light.

I wonder if an ObjectReference that points to a light can be returned from a function like http://www.creationkit.com/FindClosestReferenceOfTypeFromRef_-_Game?

Cipscis
User avatar
Dagan Wilkin
 
Posts: 3352
Joined: Fri Apr 27, 2007 4:20 am

Post » Tue Jun 19, 2012 12:57 am

http://www.creationkit.com/Light_Script extends http://www.creationkit.com/Form_Script, not http://www.creationkit.com/ObjectReference_Script, so it won't inherit functions like http://www.creationkit.com/PlaceAtMe_-_ObjectReference.

OK. I got mislead by the default type the new script extended. Every time I do it with magic effect it get's it right.
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Mon Jun 18, 2012 2:14 pm


I wonder if an ObjectReference that points to a light can be returned from a function like http://www.creationkit.com/FindClosestReferenceOfTypeFromRef_-_Game?


Which is what I started this thread about...unfortunately, as Lights don't extend ObjectReference, they are invalid as a parameter (and they can't be cast as Objectreferences, either, at least I don't know...(OW! MY BRAIN HURTS!) Didn't your tutorial page have a case of casting to a sibling? Like maybe cast Light to Form, then that Form to an Objectreference?

You're the better user of Papyrus...could that work?
User avatar
Phoenix Draven
 
Posts: 3443
Joined: Thu Jun 29, 2006 3:50 am

Post » Mon Jun 18, 2012 5:44 pm

Actually, do any lights have scripts attached to them in Skyrim.esm? I don't have access to the Creation Kit right now, so I can't check myself. I'm wondering what could be done with a script that, as far as I can tell, wouldn't run on individual instances of an object.

Lights aren't like Quests, where's there's only ever one instance of a base form, and it would make sense if they used the same reference system...

Cipscis
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Post » Mon Jun 18, 2012 12:30 pm

could that work?
No, unfortunately. That cast (actually two casts) would compile, but it would return None.

Cipscis
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Mon Jun 18, 2012 6:30 pm

Actually, do any lights have scripts attached to them in Skyrim.esm? I don't have access to the Creation Kit right now, so I can't check myself. I'm wondering what could be done with a script that, as far as I can tell, wouldn't run on individual instances of an object.

Lights aren't like Quests, where's there's only ever one instance of a base form, and it would make sense if they used the same reference system...

Cipscis

Haven't seen any vanilla lights with scripts...it's annoying that there's no easy way to get a reference to your projectiles.

I haven't been able to get FindClosestReferenceOfTypeFromRef to work on ANYTHING, but that may be because I'm trying to use it on something you can't use it on...or because I'm still having trouble getting a proper reference to a form, since Papyrus is incredibly dumb at some things (As I've commented, member variables aren't even persistant...you have to go through some byzantine process just to store a value for later use.)

And the example on the Wiki Doesnt. Even. Work!
User avatar
Ryan Lutz
 
Posts: 3465
Joined: Sun Sep 09, 2007 12:39 pm

Post » Mon Jun 18, 2012 10:43 pm

I'm pretty sure projectiles don't use the reference system - I vaguely remember trying to get a handle on a projectile in a script in Fallout 3 and not being able to do it, although that would have been some time ago and it's possible the system has changed in Skyrim anyway.

If I remember correctly, I've tested http://www.creationkit.com/FindClosestActorFromRef_-_Game (tried to find the closest Actor to the player and, of course, I found the player -_-) but I don't know if I've tested http://www.creationkit.com/FindClosestReferenceOfTypeFromRef_-_Game or one of its more closely related functions.

I do know, however, that the name is slightly misleading. Unfortunately you can't just ask it to look for, say, Activators. Instead you have to tell it what sort of base form (or, with the list one, give it a list of base forms) you're looking for. Make sure your radius is big enough, too - set it to something massive if you're just trying to get it to work at all. In previous games I think 128 units was 6 feet / 1.82 metres, and I'm fairly confident that's still the case in Skyrim.

Cipscis
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Mon Jun 18, 2012 10:39 pm

So wait... You want 2 individual spells, that allow you to basically make a Mark / Recall system?

Please give me the absolute CLEAREST definition of what you are trying to accomplish, as I still do not understand what the F you are trying to do.
User avatar
Justin
 
Posts: 3409
Joined: Sun Sep 23, 2007 12:32 am

Post » Mon Jun 18, 2012 11:49 am

So wait... You want 2 individual spells, that allow you to basically make a Mark / Recall system?

Please give me the absolute CLEAREST definition of what you are trying to accomplish, as I still do not understand what the F you are trying to do.

OK...First spell is going to interact with a bunch of other spells...it fires a projectile with a light object on it (Primarily because it's easy to see where it is, if it's on an NPC, etc) - At any time after firing it (while it's in flight, when it lands on a surface, or when or after it hits an NPC) I want to be able to trigger the other spells. The first one is teleport.

Now it's easy to do a teleport to a struck NPC or the final impact point (when it hits an NPC, I can get a reference to that NPC, when it strikes a surface, it can drop a Teleport Activator, though I still haven't found out how to use the dang search function to locate the flippin' thing, but this is just a steep learning curve (I hope)

The trouble is when the player tries to cast one of the linked-in spells while the projectile is in flight. I tried to use the light itself (which can be scripted) as a reference, but it can't be used for anything that requires any objectreference to give a location or target (As in every single spell that you can cast at a remote location) The Projectile also cannot be referenced, since it extends Form and not ObjectReference (even though you can pick up both Projectiles and Lights and put them in your inventory. Funky.)

So it's not a simple matter of Mark-and-Recall...it can do so much more once it's up and running...for example, imagine a fireball spell that you can "walk" down a hallway by casting it on a moving node...kind of a creeping barrage thing...or that you can "stick" on the boss and go hide, and keep blasting away regardless of line of sight.

Kind of like a magical wormhole you can cast spells through.
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Tue Jun 19, 2012 1:25 am

I had a play around with lights on projectiles. I think I'm now on the same wavelength.

When you attach a script to a light, the OnInit event fires immediately when you load a save game with the esp. And that's it. No matter how many projectiles you fire concurrently with the light attached, the OnInit function will not fire again.

Which means that there is only ever a single instance of the script attached to the light. Hence we can't cast a light as an ObjectReference (using for example http://www.creationkit.com/RegisterForSingleLOSGain_-_Form that a Light script should inherit from Form) because they cannot be treated as such.

In other word, it can't work.
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm

Post » Mon Jun 18, 2012 6:54 pm

I had a play around with lights on projectiles. I think I'm now on the same wavelength.

When you attach a script to a light, the OnInit event fires immediately when you load a save game with the esp. And that's it. No matter how many projectiles you fire concurrently with the light attached, the OnInit function will not fire again.

Which means that there is only ever a single instance of the script attached to the light. Hence we can't cast a light as an ObjectReference (using for example http://www.creationkit.com/RegisterForSingleLOSGain_-_Form that a Light script should inherit from Form) because they cannot be treated as such.

In other word, it can't work.

Alas, this appears so...I'll have to use another Forumgoer's suggestion of creating my own custom object to simulate a projectile...if only I could target the projectile with any kind of reference, I could add functions to the projectile to do things.
User avatar
James Hate
 
Posts: 3531
Joined: Sun Jun 24, 2007 5:55 am


Return to V - Skyrim