Aller au contenu

Photo

Visual Effect sp_skin_web disappears at spawn (RESOLVED)


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I have a script that spawns 3 creatures.  They are all the same blueprint and on the VFX field, I have the sp_skin_web effect selected.   They all spawn with the skin, but the first one to spawn consistently loses the effect about 1 second after spawning.  It happens every time and only on the first one spawned. 

Any ideas? 

Modifié par M. Rieder, 27 novembre 2011 - 06:10 .


#2
kamal_

kamal_
  • Members
  • 5 259 messages
reapply as part of spawn script.

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Done.

#4
Guest_Chaos Wielder_*

Guest_Chaos Wielder_*
  • Guests
Consider also a little heartbeat script to make sure it stays on. I've had VFXs leave on heartbeat(inexplicably).

#5
Shaughn78

Shaughn78
  • Members
  • 637 messages
I've ran into the same thing. CW solution worked for me. I created a custom HB that grabs a local string off of the creature then applies that special effect, that way I can have different skin types done with a single script.

Modifié par Shaughn78, 21 novembre 2011 - 10:17 .


#6
Dann-J

Dann-J
  • Members
  • 3 161 messages
It's especially annoying when it happens to water elementals, and they turn into metallic purple modern art sculptures.

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
hmmm.... metallic purple modern art sculpture elementals.... I might want to check that out... sounds like something that would trouble a gnome....


Thanks for all the responses. I have one idea. There was a recent thread about applying effects and removing them. One poster stated that if you apply certain effects as "instant" instead of permanent or temporary, they cannot be removed. I wonder if I applied the effect as instant at spawn if that would make it stick around.

#8
Guest_Chaos Wielder_*

Guest_Chaos Wielder_*
  • Guests
I've had nothing but oddities with SEF files. It seems like many times they remove themselves for no particular reason. This is why I found a handy HB script to be necessary to make sure the effects stayed on.

#9
MasterChanger

MasterChanger
  • Members
  • 686 messages

M. Rieder wrote...

hmmm.... metallic purple modern art sculpture elementals.... I might want to check that out... sounds like something that would trouble a gnome....


Thanks for all the responses. I have one idea. There was a recent thread about applying effects and removing them. One poster stated that if you apply certain effects as "instant" instead of permanent or temporary, they cannot be removed. I wonder if I applied the effect as instant at spawn if that would make it stick around.


If you applied it as "Instant" then it would stick around...for the time it took to display the VFX.

Only apply VFXs as instant if they are impact-type (explosions, etc.). Something that sticks around forever is permanent. Something that sticks around for a defined duration is temporary. Something that hits once and disappears is instant.

The problem with removing instant effects is not that they can't be removed. It's that there is nothing to remove--by the time you go to remove them they're already gone.

#10
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
I imagine quite a few things remove such effects coming in from other scripts. Not really seen this many issues myself but i have a lot more control over all the coding, but i know the official code folks tend to lean on has a lot of extremely brute force type tactics - just remembering my druid in the OC getting stripped of all spells prior to each battle. Another way of adding effects is creating a separate line in appearance.2da and putting the sef in the sef column ( either visualeffects.2da row number or the name of the sef file ).

If you apply it, make it's spell id a negative number ( like -999, but reserve a line in spells.2da for the positive version of said number so you don't run into a conflict ), make it supernatural or extraordinary ( not sure off the top of my head on that ), and give it a temporary duration of 200 days or somesuch the players will never notice. I think kaedrin does 48 hours and i'd use his excerpts to apply anything. All of this is mainly to make the game know it should not hopefully get stripped, but there are still quite a few functions which strip all effects, even the eye candy ones like this.

Then in the heartbeat or whatever maintenance function you have, use "GetHasSpellEffect( -999, oTarget )" to see if its still there, and reapply if it's not there using a string constant on the creature. I'd probably put such a function in on spawn, perhaps in the AI, but a heartbeat like that could really damage the server even if that is all it does if you have a lot of creatures. I'll try to figure out if there is a efficient way to do it that does not create a hell of script activity. Might be something i can piggy back onto the AI itself without creating much expense overall compared to running another heartbeat. ( my optimizations should allow adding in something back like this without coming near the original load )

I am already working out my own on spawn handler for the CSL, which has options like guard and flee, and trying to work out what else is needed AI wise.

#11
Dann-J

Dann-J
  • Members
  • 3 161 messages

MasterChanger wrote...

The problem with removing instant effects is not that they can't be removed. It's that there is nothing to remove--by the time you go to remove them they're already gone.


I believe the problem in question arises when a persistent effect is applied as instant. If you applied the ghost visual effect (transparency, green eye glow and green vapour) as instant, you would then no longer be able to remove the effect via a script that cycled through all effects and attempted to remove it. It's as if the effect no longer has a handle for a script to grab hold of (or never had one to being with).

If the problem with VFX being removed from a creature is due to a script somewhere removing it, then applying it as an instant effect might prevent any script from being able to strip it. That assumes that it's not actually a glitch in the game engine that causes the problem.

#12
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I made a custom spawn script and used this code and it fixed the problem:

void main()
{
object oSelf = OBJECT_SELF;
effect eVFX = EffectNWN2SpecialEffectFile("sp_skin_web");

ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFX,oSelf,1500000.0);
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFX,oSelf,1500000.0));
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFX,oSelf,1500000.0));
}

Modifié par M. Rieder, 27 novembre 2011 - 06:09 .