Difference between revisions of "Talk:SetPlayerProjectile"
imported>Haama |
imported>Mitchalek (Bug found if target is killed via script attached to the spell that has been set to player projectile) |
||
Line 16: | Line 16: | ||
--[[User:Khrabanas|Khrabanas]] 03:00, 23 August 2008 (EDT) | --[[User:Khrabanas|Khrabanas]] 03:00, 23 August 2008 (EDT) | ||
:I've made a template based on this example and added it to all of the projectile function articles.--[[User:Haama|Haama]] 11:28, 23 August 2008 (EDT) | :I've made a template based on this example and added it to all of the projectile function articles.--[[User:Haama|Haama]] 11:28, 23 August 2008 (EDT) | ||
I have found a bug. If target dies from a scripted spell that has been shot from an activator and changed to player projectile all actors that use ranged spells will stop using them for the rest of game session, instead they will just try to summon creatures and attack with melee attacks when approached close enough. It only happens when script is responsible for death. | |||
I'd also like to add that if you want to avoid getting skillup set type to lesser power. | |||
[[User:Mitchalek|Mitchalek]] 16:03, 6 October 2011 (EDT) |
Revision as of 15:03, 6 October 2011
This is an incredibly useful function, but actually getting a reference to a projectile is not explained in the OBSE documentation. The most common use of this is probably going to be catching a scripted effect shot by a hidden activator - here's an example of how to do it:
pActivator.Cast MySpell pTarget; (cast MySpell from pActivator at pTarget) ref pProjectile set pProjectile to GetFirstRef 34 label 4 if (pProjectile != 0) if (pProjectile.GetProjectileSource == pActivator) pProjectile.SetPlayerProjectile endif set pProjectile to GetNextRef goto 4 endif
The shot will be caught instantly and will be treated just like the player fired it. That also means that the player will get the skill increase from the shot hitting a target, which may not be desirable. --Khrabanas 03:00, 23 August 2008 (EDT)
- I've made a template based on this example and added it to all of the projectile function articles.--Haama 11:28, 23 August 2008 (EDT)
I have found a bug. If target dies from a scripted spell that has been shot from an activator and changed to player projectile all actors that use ranged spells will stop using them for the rest of game session, instead they will just try to summon creatures and attack with melee attacks when approached close enough. It only happens when script is responsible for death.
I'd also like to add that if you want to avoid getting skillup set type to lesser power. Mitchalek 16:03, 6 October 2011 (EDT)