I’m working on a module that when the PC approaches a corpse it springs up as a zombie. All I’ve done is taken the Zombie Corpse placeable and edited the script to create a customized zombie rather than the randomly generated zombie of the standard script.
It does create the right zombie. And the placeable is destroyed. But for some reason the visual effect isn’t playing at all. So the zombie just seems to appear out of thin air.
Any help would be appreciated. Following is the script I’m using:
To post code enclose it in [code] and [/code]. Why bother? 2 reasons -
It preserves your layout.
When in a code box you can automate copying it to the clipboard. Just hover your mouse pointer anywhere over the code and a copy button will appear in the top right of that box. Click on that box and all the code in the code box is copied to the clipboard. Try it out. Here is your code from above in such a code box (I’ve only added a couple of line breaks) -
That certainly should work - it is basically the default script except for some minor changes - none of which changes the effect or the application of it.
Could it have something to do with the zombie blueprint you are using?
If the model hasn’t loaded the vfx may not play. Nwn loads models more reliably but sometimes slower and so just applying it at the monsters location which should work.
What Jasperre said. You need the model to exist for some time for applying VFX successfully to it. Usually, just using a delay between spawn and vfx does the trick. Try something like
DelayCommand(0.3,ApplyEffectToObject(DURATION_TYPE_INSTANT, eMind, oMonster));
In my experience, it seems 0.2-0.3s is more or less the threshold to VFX working stable but you could always use a bigger delay if needed. Of course you need to adapt the script destruction delay accordingly to allow the timed VFX to work.