Jump to content

X-Ray Life Detect


LeLorrain

Recommended Posts

Hi!

 

I am trying to setup a script to improve on the terrific idea of Dark Tyrian. The problem with the MOD is that the effect is active for actors which are in the line of sight of the player and especially when they are close.... then the effect gives an unwanted (IMHO) weird view of the inward of the model.

 

This is my first attempt at modding and I must say that I am failing miserably! I think that my idea would be in the correct direction, but I do not know how I to get it to trigger to remove the effect.

 

Here is what I did:

 

ScriptName  LifeDetectXray

Ref	Actor
Ref	fAIExteriorSpectatorDistance
Ref	fAIInteriorSpectatorDistance

Long	ViewDistance	; Minimum distance for effect to show when in Ligne of Sight

Begin onMagicEffectHit DTCT
;
;	Check that the NPC or Creature is NOT in ligne of sight
;	If LoS, then check that the distance is far enough for the life detection effect.
;
if player.IsInInterior
	;	Interior minimum distance for effect
	Set ViewDistance to fAIInteriorSpectatorDistance
else 
	;	Exterior minimum distance for effect
	Set ViewDistance to fAIExteriorSpectatorDistance
endif
if IsActionRef player == 1
	player.stopMagicEffectVisuals DTCT
else
	;	Only for NPC's and Creatures
	Set Actor to GetActionRef
	if Actor.GetLOS player == 0
		;	NPC or Creature hidden
		Actor.PlayMagicEffectVisuals DTCT
	else
		;	Player is in ligne of sight of NPC/Creature
		if Actor.GetDistance player > ViewDistance
			Actor.PlayMagicEffectVisuals DTCT
		else
			Actor.stopMagicEffectVisuals DTCT
		endif
	endif
endif
end

 

I would appreciate it very much if someone with scripting experience would be willing to help me resolve that problem. I think that the end result would make it a very good mod.

 

Thank you,

 

LeLorrain

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...