TK-664 69 Posted July 9, 2019 Say I want a container to have a permanent energy shield visual effect, how would i go about that? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 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. 1 Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 What do you mean by onSpawn? Sorry I'm not familiar with scripting and whatnot Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 It's a creature script type. OnHeartbeat should work and reapply it even if the party re-enter a module on subsequent occasions. Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 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? : Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 No. And if it's the object's OnHeartbeat then it stays OBJECT_SELF. 1 Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 It' didn't work, the container still has no effect. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 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. Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 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. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 Works fine here. Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 I don't get it, isn't this all there is to it? Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 Your script resref has too many characters. The maximum filename character count is 16. Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 Ah OK i didn't know that was an issue, thank you! EDIT: Still nothing @DarthParametric Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 You compiled the script I take it? Put the NCS and UTP in the Override (or module)? Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 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. Quote Share this post Link to post Share on other sites
DarthParametric 3,777 Posted July 9, 2019 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). 1 Quote Share this post Link to post Share on other sites
TK-664 69 Posted July 9, 2019 Done! Works as intended. Thank you for helping me out. Quote Share this post Link to post Share on other sites