Difference between revisions of "Talk:Cast"

4,997 bytes added ,  00:14, 8 April 2010
imported>Scruggs
(possible workaround)
imported>DragoonWraith
 
(17 intermediate revisions by 6 users not shown)
Line 14: Line 14:


:Yeah, that's really annoying, especially since if an NPC is too far away from the target or just isn't in the mood, he'll sometimes just ignore the Cast completely.
:Yeah, that's really annoying, especially since if an NPC is too far away from the target or just isn't in the mood, he'll sometimes just ignore the Cast completely.
:The only idea I have off-hand is to tell the NPC to call [[Look]] to make the NPC face the target, tell him to play the casting animation, and then stick an activator in front of him to cast the spell at the target. Probably not what you wanted to hear.
:The only idea I have off-hand is to call [[Look]] to make the NPC face the target, tell him to play the casting animation, and then stick an activator in front of him to cast the spell at the target. Probably not what you wanted to hear.


:Might be worth popping over to the [[OBSE Wish List]] to put in a request. They really do take requests into consideration, although they've got plenty to keep them busy already. [[User:Scruggs|Scruggs]] 00:55, 8 December 2006 (EST)
:Might be worth popping over to the [[OBSE Wish List]] to put in a request. They really do take requests into consideration, although they've got plenty to keep them busy already. [[User:Scruggs|Scruggs]] 00:55, 8 December 2006 (EST)
[[User:DragoonWraith|<font face="Oblivion,Daedric Runes" size=2>D</font>ragoon <font face="Oblivion,Daedric Runes" size=2>W</font>raith]] [[User_talk:DragoonWraith|<font face="Oblivion,Daedric" size=2>TALK</font>]] 16:12, 21 May 2007 (EDT): Heh, could have sworn that Casting at an Activator didn't work when I tested it... but I was trying so many different things to get it to work, so who knows. I didn't realize it was an issue with Cast until later on in my testing, so I was trying to use different things to get MoveTo/SetPos to work, assuming those were the problems with my script's horrible aim. Anyway, thanks for fixing that, mmmpld and Scruggs! Good to know about the Self range spells for the player, too.
What happens if Cast is used on the player, with a Target spell, and no target ID is supplied?  Does it cast along the current heading, or does it not cast at all? [[User:Abramul|Abramul]] 18:53, 23 October 2007 (EDT)
:Just tried it - it doesn't compile... wondering about this myself. I want to be able to cast a spell at a door whenever the player presses Activate - guess I need to get the player's heading and position, move a disabled activator to the player's position, move a second activator some 200-300 units in front of the player, and cast the spell?
:--[[User:Haama|Haama]] 23:27, 14 November 2007 (EST)
== Spell casting from an object ==
Something that I didn't find in any reference, and that is worth mentioning imho: '''''Cast must be called from a reference'''. Items in inventories aren't references.''
Wich means that any item in your inventory will not execute a cast function from within its attached script (MenuMode block, OnEquip block, etc.), and the script just moves on to the next line of code. This issue was [http://www.bethsoft.com/bgsforums/index.php?showtopic=799581 discussed on Bethesda forum].
--[[User:HawkFest|HawkFest]] 03:06, 21 January 2008 (EST)
:Mm, this is true. It's true of most functions, actually. Scripted items in inventories can't actually do very much without supplying a reference.
:You can use [[GetContainer]] to do what I assume you were trying to do - to get the person holding the item to cast the spell.
:Or you can use a Disable, Persistent Activator to cast the spell on the Ref from GetContainer, if you want to spell to be cast on the person holding the item.
:[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 16:20, 21 January 2008 (EST)
::Added it to the article - there was a (quick) [http://forums.bethsoft.com/index.php?/topic/1082474-quick-questions-quick-answers-the-21st/page__view__findpost__p__15817734 question] in  the forums that boiled down to this. Still not sure if cast would run if called from a ''non-dynamic'' ref in an inventory. These references stay the same whether or not in an inventory. Anyone ? [[User:UDUN|UDUN]] 08:22, 4 April 2010 (EDT)
::EDIT : quick tested - seems cast does not run even on (persistent or not) non dynamic references. GetSelf on these in an inventory still returns 0. [[User:UDUN|UDUN]] 10:59, 4 April 2010 (EDT)
:::Not sure what you mean by "non-dynamic" - it just needs a reference. An object in an inventory is ''not'' a reference, and therefore will not work.
:::[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 11:30, 5 April 2010 (EDT)
::::I meant non FFxxxxxx form IDs. These stay the same before and after putting them in a container - but, yes, while ''in'' the container they are zeroed. Wasn't sure about this bit. [[User:UDUN|UDUN]] 11:46, 5 April 2010 (EDT)
:::::Items in containers '''''do not have referecnes'''''. You need a reference to use this function. You don't need any FF~ formID, just an actual reference.
::::::A reference ''is'' a formID. I wrote ''non'' FFxxxxxx. This comment will destroy itself, please delete yours also - to keep these pages as clean as possible :) [[User:UDUN|UDUN]] 08:29, 7 April 2010 (EDT)
:::::::Excuse me? Uh, no, we're not in the habit of deleting discussions on the Wiki. Having a formID does not make something a reference. Frankly, you are wrong. You don't need an FFxxxxxx formID to use Cast. You need a reference. An object in a container is not a reference, does not ''have'' a reference. None exists to cast the spell. I'm confused what the issue is.
:::::::[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 00:14, 8 April 2010 (EDT)