Jump to content

Scripted Effect for Multiple Creatures?


Teabone3

Recommended Posts

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
END

Above 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 by Teabone3
Link to comment
Share on other sites

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

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 by Teabone3
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...