Teabone3 Posted April 24, 2016 Share Posted April 24, 2016 (edited) Hey everyone, ive been looking to close up a bunch of my mods I have uploaded to the Nexus over the years. But it requires a bit more script work then I'm able to do without assistance it seems. I would like a script to apply effects on a creature. Sounds simple and I've been able to make this work. However it only works for creatures i uniquely name in the worldspace: scn CreatureEffectSCRIPT short DoOnce Begin Gamemode If CreatureName.GetHealthPercentage <= 0.30 && DoOnce == 0 CreatureName.CastImmediateOnSelf UniqueSpell Set DoOnce to 1 Endif ENDAbove is an example of the script. As you can see it will only work if I give the NPC ID on the worldspace a name like "creaturename". What I want is multiple creatures to have the ability to apply this scripted effect. But not all creatures. Only ones that have the SCRIPT associated to them. Is there a way to make it so that the "creaturename" is automatically grabbed by the script itself rather than me writing it out and creating a script for each creature? (above script would apply an effect once its health is less than or equal to 30%) Edited April 24, 2016 by Teabone3 Link to comment Share on other sites More sharing options...
RoyBatterian Posted April 24, 2016 Share Posted April 24, 2016 If your creatures are not overriding base creatures (and they shouldn't) You can add the script to the creature's template or base form. You don't need to then supply a reference as the reference is assumed to be the creature it is attached to. Link to comment Share on other sites More sharing options...
Teabone3 Posted April 24, 2016 Author Share Posted April 24, 2016 (edited) for some reason it says "only object references and references variables allowed in this context" when applying to just a template and putting the NPC ID as the "CreatureName". Or are you saying there is a way to make the script work without "CreatureName"? It seems to not give an error without it. I'll see if it works! Edited April 24, 2016 by Teabone3 Link to comment Share on other sites More sharing options...
Teabone3 Posted April 24, 2016 Author Share Posted April 24, 2016 Thanks so much it worked! Link to comment Share on other sites More sharing options...
RoyBatterian Posted April 24, 2016 Share Posted April 24, 2016 No problem. :) Link to comment Share on other sites More sharing options...
Recommended Posts