TK-664

Apply vfx to objects

Recommended Posts

Say I want a container to have a permanent energy shield visual effect, how would i go about that?

Share this post


Link to post
Share on other sites

It would need to be scripted. There are a couple of ways to go about it, depending on the circumstances. Could be included in the object's OnSpawn perhaps, or if it is a continually revisited area it may need to be done in the module's OnEnter to ensure it stays up. For the former, perhaps something like

void main(){
	
	effect eVFX = EffectVisualEffect(VFX_DUR_SHIELD_BLUE_01);

	ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVFX, OBJECT_SELF);
}

For the latter, you'd replace the OBJECT_SELF reference with an object declaration/GetObjectByTag.

  • Thanks 1

Share this post


Link to post
Share on other sites

What do you mean by onSpawn? Sorry I'm not familiar with scripting and whatnot

screeno.PNG.8a3c1682dbb0be51b00b8a760a5c482b.PNG

 

Share this post


Link to post
Share on other sites

Okay

28 minutes ago, DarthParametric said:

For the latter, you'd replace the OBJECT_SELF reference with an object declaration/GetObjectByTag.

So... replace OBJECT_SELF with this? :    screeno.PNG.ecd9a9142f45b8740a6ffdd2c2cdee78.PNG

Share this post


Link to post
Share on other sites
23 minutes ago, DarthParametric said:

It won't work in a module you've already been in. The original version of the object will be stored in your save file.

Well yes, I'm well aware. I'm always warping to a module which i didn't reach yet for testing.

Share this post


Link to post
Share on other sites

Threw it in the Override.

Compiled the script? I'm not sure, all i did was delete the contents of the default script from one of the templates and replaced it with your code.

Share this post


Link to post
Share on other sites
6 minutes ago, TK-664 said:

I'm not sure

I'll take that as a no then. The engine only deals with binary (compiled) scripts, NCS. What I posted was source, plain text (NSS). The game won't do anything with that. You have to compile it first. You can do it via KOTOR Tool, or directly use NWNSSCOMP via commandline. There are also a few other frontends around, like the KOTOR Script Tool (check the Tools section in Downloads).

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.