Difference between revisions of "Talk:SetPlayerProjectile"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Mitchalek
(Bug found if target is killed via script attached to the spell that has been set to player projectile)
imported>Mitchalek
m
Line 17: Line 17:
: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 have found a bug. If target <s>dies from a scripted</s> is hit by 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. <s>It only happens when script is responsible for death.</s> First I tought it is related to script but then I tested some more and it appear to happen even with normal effects and is not related to death. I have hard time to nail down the exact cause as it doesn't seem to happen after first cast. I am doing more testing right now and it appear to happen when casting from activator few times in a row with short time between casts and setting to player spell each time. I'll keep you updated if I find out more.


I'd also like to add that if you want to avoid getting skillup set type to lesser power.
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)
[[User:Mitchalek|Mitchalek]] 16:03, 6 October 2011 (EDT)

Revision as of 17:00, 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 is hit by 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. First I tought it is related to script but then I tested some more and it appear to happen even with normal effects and is not related to death. I have hard time to nail down the exact cause as it doesn't seem to happen after first cast. I am doing more testing right now and it appear to happen when casting from activator few times in a row with short time between casts and setting to player spell each time. I'll keep you updated if I find out more.

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)