Author Topic: Ghosts  (Read 642 times)

Legacy_Grieyls

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
Ghosts
« on: August 22, 2010, 07:10:21 am »


               Ok, wanted to make an NPC ghost for a while now and I found a script on the nwnvault that does the trick. It applies Ghostly Visage to the NPC. Not perfect I know but it's good enough I guess. Anyway, trouble is that the script does not make the effect immortal. That is to say that it can be dispelled. Now I understand that I need to make the effect Supernatural but I have no idea how to add such a script to what I have. Still trying to struggle with scripting and it confuses me to no end still. So, how can I make it godly?

Anyhoo, this is what I have thus far...

/*
SpawnIn script, changes NPC into a ghost
*/
void main()
{
    ExecuteScript("sm_c2_default9", OBJECT_SELF);
// Start The relevant stuff
    effect vfx = EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, vfx, OBJECT_SELF);
// End The relevant stuff
}
               
               

               


                     Modifié par Grieyls, 22 août 2010 - 06:14 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Ghosts
« Reply #1 on: August 22, 2010, 07:59:53 am »


               can't you simply make the NPC set on immortal? There should be a box in the creatures property that you can check.



I think thats a lot easier then creating a script for it...



Cause what exactly do you want with it? being uber strong or just not to die?
               
               

               
            

Legacy_Grieyls

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
Ghosts
« Reply #2 on: August 22, 2010, 08:23:47 am »


               Niether, I just don't want the "Ghostly Visage" effect that it has when it spawns in to be dispelled. Checking the Immortal box does not stop this. I can check the plot box which stops any dispelling but then the "Ghost" cannot be killed at all. Thus I need a script that a) Apllies the effect to the NPC on spawn and 'B)' negates any dispell made on the NPC ineffective.

Anyway, I tried the following to but it did not stop a dispelling [sighs]

/*
SpawnIn script, changes NPC into a ghost
*/
void main()
{
          ExecuteScript("sm_c2_default9", OBJECT_SELF);
// Start The relevant stuff
          effect vfx;
          vfx = EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE);
          vfx = SupernaturalEffect(vfx);
                   ApplyEffectToObject(DURATION_TYPE_PERMANENT, vfx, OBJECT_SELF);
// End The relevant stuff
}
               
               

               


                     Modifié par Grieyls, 22 août 2010 - 07:25 .
                     
                  


            

Legacy_Grieyls

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
Ghosts
« Reply #3 on: August 22, 2010, 08:38:49 am »


               Aha! I figured it out... Silly me.

I changed vfx to eEffect and tada! It works 'Posted

So the script looks like this....

/*
SpawnIn script, changes NPC into a ghost
*/
void main()
{
    ExecuteScript("sm_c2_default9", OBJECT_SELF);
// Start The relevant stuff
    effect eEffect;
    eEffect = EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE);
    eEffect = SupernaturalEffect(eEffect);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, OBJECT_SELF);
// End The relevant stuff
}
               
               

               


                     Modifié par Grieyls, 22 août 2010 - 07:40 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Ghosts
« Reply #4 on: August 22, 2010, 10:06:05 am »


               Err. must have been something else then. It doesn't matter what you call the effect. It could be effect eCherrios or effect xUnderwear or effect LoveyBear and it would still work. A lot of times you will see an effect being named "eEffect" because it is just a generic name and can make it easier to know what yer looking at when reading the script.'<img'>
               
               

               


                     Modifié par GhostOfGod, 22 août 2010 - 09:10 .
                     
                  


            

Legacy_C Writer

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +0/-0
Ghosts
« Reply #5 on: August 22, 2010, 02:09:59 pm »


               

Who said that I wrote...

can't you simply make the NPC set on immortal? There should be a box in the creatures property that you can check.


He was talking about changing the effect so that it can't be dispelled. He wasn't referring to the immortality flag.
EDIT: I must say, now I see why you've named yourself "Who said that I".


Grieyls wrote...

Aha! I figured it out... Silly me.

I changed vfx to eEffect and tada! It works 'Posted

So the script looks like this....

/*
SpawnIn script, changes NPC into a ghost
*/
void main()
{
    ExecuteScript("sm_c2_default9", OBJECT_SELF);
// Start The relevant stuff
    effect eEffect;
    eEffect = EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE);
    eEffect = SupernaturalEffect(eEffect);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, OBJECT_SELF);
// End The relevant stuff
}


That is indeed one way of doing it, but the script is longer than it needs to be.

"effect = SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE));" is all you need. Coming to think of it, this is all you need:

"ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectVisualEffect(VFX_DUR_GHOSTLY_VISAGE)), OBJECT_SELF);"
Although the one above might be easier to understand. It doesn't matter that much though.
               
               

               


                     Modifié par C Writer, 22 août 2010 - 01:16 .
                     
                  


            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Ghosts
« Reply #6 on: August 22, 2010, 03:10:04 pm »


               There are a bunch of VFX constants that can be used for something like this. You may also want to try:

VFX_DUR_ETHEREAL_VISAGE                                  'Posted
VFX_DUR_GHOST_SMOKE                                         'Posted
VFX_DUR_GHOST_SMOKE_2                                    'PostedVFX_DUR_GHOST_TRANSPARENT                         'PostedVFX_DUR_GHOSTLY_PULSE                                    'PostedVFX_DUR_GHOSTLY_VISAGE                                   'PostedVFX_DUR_GHOSTLY_VISAGE_NO_SOUND         'Posted

More info can be found at the NWN Lexicon under Reference >> Constants >> VFX_DUR_*
               
               

               


                     Modifié par invisig0th, 22 août 2010 - 02:15 .
                     
                  


            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
Ghosts
« Reply #7 on: August 24, 2010, 12:09:01 pm »


               Don't quote this, but I think if you apply the CUTSCENE_GHOST effect to them they can also do things like walk through doors and other creatures.
               
               

               
            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Ghosts
« Reply #8 on: August 24, 2010, 06:33:26 pm »


               I believe you're referring to EffectCutsceneGhost(). That allows pathfinding through other creatures only, but it might very well be useful here.

Description
Creates a cutscene ghost effect, this will allow creatures to pathfind through other creatures without bumping into them for the duration of the effect.

This is not used in any spells, it could potentially be dangerous if you specifically have a creature blocking a  passage you do not want accessed, so be careful with it.

It will not allow, and nothing will, access through placeables or doors, or line of sight (LOS) through them. This is on purpose with this effect.

The target this effect is applied to must be a creature for it to work. This effect cannot be applied instantly, only temporarily or permanently.

Remarks
This is good for NPCs like Ghosts (duh), and Gletanous Cubes which can pass through creatures (and cubes can paralyze those who stay into them). There is no way to pass through placeables, still, however.


Please see NWN Lexicon for more details.
               
               

               


                     Modifié par invisig0th, 24 août 2010 - 05:36 .
                     
                  


            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Ghosts
« Reply #9 on: August 24, 2010, 10:49:27 pm »


               Easy way of doing this is just setting the onspawn code or whatever effect you want to cause this "ghost" effect. Just make sure you use x2_switches_inc on your module load, then add the effects listed above to the creature properties if that is desired. If you want a script that turns it off or on, that can be done as a conditional. In conversation, or after an effect, or even attached to a quest/plot script.



invisig0th  listed all the available effects you'd want, so choose em and add it under the variables tab on the creature. There ya go.
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Ghosts
« Reply #10 on: August 25, 2010, 01:50:38 am »


               If you want a creature to be a true ghost, you have to apply a variable to them, don't remember the variable, and you can also apply the VFX, and maybe even given them like 50% Concealment too (wouldn't hurt to give it like 80 AC either)  '<img'>