New function discovery? IF(pGhostDeathFXShader != none)

Post » Fri Nov 16, 2012 6:06 pm

I need to detect ACTOR "Ghosts". There is no factions that they all belong to, no Keyword, and no obvious function to detect them (GetISGhost is not the same thing in spite of the confusing name of that Function. That has to do with the collision not the actor being a "ghost". Almost none of the Ghosts in Skyrim are set as SetGhost()

The only thing I could come up with was this:

IF(pGhostDeathFXShader != none)

THIS I found in Bethesda's script for all the ghosts I have looked at so far.

SO I would try this:

IF (me.GhostFXShader != none)

So yes that is very cool, but wait...er... HUH? How many other forms like that can be used that way as a function?

Like would this detect the actor making the draw bow sound:

IF (aadpWPNBowPull != none)

Probably not but that was the first thing that came to my mind as I would really like a sound detection function.
So anyone else know about this? What else do you know in this area of interest? Any others examples that you know work?
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am

Post » Sat Nov 17, 2012 3:04 am

ok, so this only works in a script that is attached to the actor.

This will not compile:

IF (me.GhostFXShader != none)

Dang it all... now how will I detect the ghosts. :ermm:
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm

Post » Fri Nov 16, 2012 4:37 pm

this should work (pseudo code) :


if myObject.GetVoiceType() == "Formlist for ghost voices"
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Fri Nov 16, 2012 4:36 pm

Okay, I took a look at the defaultGhostScript file. What I find is that pGhostDeathFXShader is a property, not a function. It is defined at the very top of the file:


EFFECTSHADER PROPERTY pGhostFXShader AUTO

Since it is a property defined in that script, you can use it in the script, but if you try to use that same variable in another script, it's not going to be defined so it will give an error.

The function you are actually using is http://www.creationkit.com/EffectShader_Script. If you want to use that function in your own script, then you need to define it (see the above code) and pass in the value.

Does that make sense?
User avatar
*Chloe*
 
Posts: 3538
Joined: Fri Jul 07, 2006 4:34 am

Post » Fri Nov 16, 2012 2:44 pm

That is not the issue, but thanks anyway.

I did set my shader ref as a property,

IF (GhostFXShader != none)

would compile but

IF (me.GhostFXShader != none)

would not compile.


So this will not work for me in my Abilities script.
If you are saying that this was only checking to see if the property was valid and NOT checking to see if the actor had the shader than yes, you are right I misunderstood what it was doing.


Okay, I took a look at the defaultGhostScript file. What I find is that pGhostDeathFXShader is a property, not a function. It is defined at the very top of the file:


EFFECTSHADER PROPERTY pGhostFXShader AUTO

Since it is a property defined in that script, you can use it in the script, but if you try to use that same variable in another script, it's not going to be defined so it will give an error.

The function you are actually using is http://www.creationkit.com/EffectShader_Script. If you want to use that function in your own script, then you need to define it (see the above code) and pass in the value.

Does that make sense?
User avatar
Peter lopez
 
Posts: 3383
Joined: Mon Sep 10, 2007 5:55 pm

Post » Fri Nov 16, 2012 9:00 pm

Are you sure about http://www.creationkit.com/IsGhost_-_Actor? I just tried
Debug.Trace("Bag is a a ghost? " + BagOfHoldingACHR.IsGhost())  ; "Is Ghost" is ticked. SetGhost never used on it.Debug.Trace("Player is a a ghost? " + PlayerREF.IsGhost())Debug.Trace("Fjori is a a ghost? " + (Game.GetForm(0x0003D726) As Actor).IsGhost())Debug.Trace("Holgeir is a a ghost? " + (Game.GetForm(0x0003D727) As Actor).IsGhost())Debug.Trace("Luah is a a ghost? " + (Game.GetForm(0x0002335A) As Actor).IsGhost())
...and it only returned true for actors with their "Is Ghost" flags ticked.
[07/02/2012 - 11:41:31PM] Bag is a a ghost? TRUE[07/02/2012 - 11:41:31PM] Player is a a ghost? False[07/02/2012 - 11:41:31PM] Fjori is a a ghost? TRUE[07/02/2012 - 11:41:31PM] Holgeir is a a ghost? TRUE[07/02/2012 - 11:41:31PM] Luah is a a ghost? False

PlayerREF.SetGhost(True)Debug.Trace("Player is a a ghost? " + PlayerREF.IsGhost())
...resulted in...
[07/02/2012 - 11:46:53PM] Player is a a ghost? TRUE
...so it would appear it's all about that flag.


If GhostFXShader ; (GhostFXShader != None) 
just checks if there's a value for the property and would return 'False' only if the property were not filled or had been set to 'None'
User avatar
Carys
 
Posts: 3369
Joined: Wed Aug 23, 2006 11:15 pm

Post » Sat Nov 17, 2012 1:05 am

Yes, I am very sure, ISGhost is not the same thing in spite of the confusing name of that Function.

That has to do with the collision not the actor being a "ghost". Almost none of the Ghosts in Skyrim are set as SetGhost()
Look at the actor list and check a few ghosts, many are not tabbed as ghost. The ones that are I would guess they do not want the player to hit them at all.

This confused a lot of people in Oblivion moding as well. I only know this very well because I was the first (AFAIK) to make a Dodging mod in Oblivion.
So for about a year or more I was working a lot with that command. Setting an actor to GHOST means only that they cannot be attacked as the weapons and arrows pass thru them with no hit registered. But being A GHOST ACTOR in this game means you play a ghost shader, have a ghost voice and that is the only two things they all have in common from what I can find.


Are you sure about http://www.creationkit.com/IsGhost_-_Actor? I just tried
Debug.Trace("Bag is a a ghost? " + BagOfHoldingACHR.IsGhost())Debug.Trace("Player is a a ghost? " + PlayerREF.IsGhost())Debug.Trace("Fjori is a a ghost? " + (Game.GetForm(0x0003D726) As Actor).IsGhost()) ; "Is Ghost" is ticked. SetGhost never used on it.Debug.Trace("Holgeir is a a ghost? " + (Game.GetForm(0x0003D727) As Actor).IsGhost())Debug.Trace("Luah is a a ghost? " + (Game.GetForm(0x0002335A) As Actor).IsGhost())
...and it only returned true for actors with their "Is Ghost" flags ticked.
[07/02/2012 - 11:41:31PM] Bag is a a ghost? TRUE[07/02/2012 - 11:41:31PM] Player is a a ghost? False[07/02/2012 - 11:41:31PM] Fjori is a a ghost? TRUE[07/02/2012 - 11:41:31PM] Holgeir is a a ghost? TRUE[07/02/2012 - 11:41:31PM] Luah is a a ghost? False/code][code]PlayerREF.SetGhost(True)Debug.Trace("Player is a a ghost? " + PlayerREF.IsGhost())
...resulted in...
[07/02/2012 - 11:46:53PM] Player is a a ghost? TRUE
...so it would appear it's all about that flag.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Sat Nov 17, 2012 5:43 am

Yes, I have found that the SetGhost(True) only affects the collision mesh also, not the "look" of the NPC, that is in the textures (best I know). I'm using SetGhost() and IsGhost() in my mod to disable the collision and it works fine, but it doesn't change their look and I'm sure none of the users realize their follower is a ghost while on the carriage.

But, to answer the title of your thread: New function discovery? IF(pGhostDeathFXShader != none)

The answer was no, that's the property name.
User avatar
Janine Rose
 
Posts: 3428
Joined: Wed Feb 14, 2007 6:59 pm

Post » Fri Nov 16, 2012 4:24 pm

So getting the voice type will not work either, only a few have a "ghost" voice type and most of the rest use NORMAL voice type (oh for god sake...)

Seriously.... the developers had no need to detect a Ghost in their game! :wallbash:


I will ask the moderator to lock this (the OP question was answered) and start a new thread.
User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Fri Nov 16, 2012 8:57 pm

You could hit up SKSE for Actor.GetAlpha() :shrug:
User avatar
Adam Kriner
 
Posts: 3448
Joined: Mon Aug 06, 2007 2:30 am

Post » Sat Nov 17, 2012 5:52 am

So, slightly off topic, foo.SetGhost(true) cancels collision for foo?

I need to cancel a SKSE request :)
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Post » Fri Nov 16, 2012 4:21 pm

So, slightly off topic, foo.SetGhost(true) cancels collision for foo?

I need to cancel a SKSE request :smile:
Yes, that's all I use it for.
User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am


Return to V - Skyrim