Jump to content

Adding scripts to actors


TheMrDomino

Recommended Posts

I'm having an issue with adding scripts to actors. I have a script I wrote that needs to be added to several different creature actors in the game. For simplicity's sake, I'll just use skeletons as an example. There are several skeleton actors, but most of them are based off of a handful of encounter actors that are used as templates. It seems the most efficient way to get what I want done is to attach the script to the templates and call it a day. The problem is the template actors script box is, while empty, greyed out. Every other skeleton actor has editable scripts, but not these few.

 

I decided to get creative when I noticed that the actors used as templates didn't use any templates themselves. So, I created a dummy actor and attached the script to that, and then went to the template actors and modified them so that they in turn used a template, inheriting scripts from the dummy actor. Saved the mod and went to test it, but no dice. Upon reloading in the creation kit, I look at the dummy actor and discover that its script box is now greyed out (and empty) as well.

 

What's going on? I need to attach this script to these actors but am now out of ideas.

Link to comment
Share on other sites

Well i am pretty positve it should work. I was playing around with the ambush prefabs recently and as far as i can remeber the actors i built on their template all had the masterambush-script attached (not sure though.. cant check as i am not home right now). This may sound obvious, but did you try checking/ unchecking the box "use script" below the template dropbox?
Link to comment
Share on other sites

Adding a template to an actor wasn't the issue, I could add the dummy template just fine. My problem was that once I added the dummy to certain actors as a template, the dummy itself lost its script box. It became greyed out with no scripts displaying in it.

 

In-game testing showed that the script wasn't activating, either.

Link to comment
Share on other sites

Ah! I had read that, too. Must have been before I understood the ramifications of what it was actually saying. Well, looks like my job just got even more complicated.

 

I swear, for what was supposed to be a 'simple' mod, it's giving me no end of trouble.

Link to comment
Share on other sites

  • 2 weeks later...

Ah! I had read that, too. Must have been before I understood the ramifications of what it was actually saying. Well, looks like my job just got even more complicated.

 

I swear, for what was supposed to be a 'simple' mod, it's giving me no end of trouble.

 

If you make a copy of the actor form, the script box in the copy won't be greyed out :thumbsup: . The only disadvantage is that this will be a new creature, it won't be modifying any of the existing creatures already placed in the gameworld.

 

Edit: Hey, I had a cunning idea. Why not attach the script to the creature's SKIN armor form? That might work :dance: It would be easier than the "ability" workaround. So for a skeleton you would add your script to Items->Armor->SkinSkeleton.

Edited by steve40
Link to comment
Share on other sites

Much easier, more reliable, and generally better due to avoiding mod conflicts to apply scripts to actors using reference aliases or magic effects. I personally prefer magic effects, to me, they give the most flexibility. You can create a cloak effect for example to apply scripts dynamically to actors near you, and use formlists, conditions or if statements as conditions to narrow the range of actors that your script runs on. This way, it works with.actors added by other mods if you want it to, and will not conflict with mods that use the actor you are adding the script to.

 

If it is a new actor in a leveled list, one that other mods won't be touching or using, then adding a spell ability to that creatures race or actor form is probably best, and is pretty easy to do. Activemagiceffect scripts get events from the actor they are attached to, so you can.do everything in activemagicwffect that you can do in actor.

Edited by elseagoat
Link to comment
Share on other sites

  • 2 weeks later...

I'm having an issue with adding scripts to actors. I have a script I wrote that needs to be added to several different creature actors in the game. For simplicity's sake, I'll just use skeletons as an example. There are several skeleton actors, but most of them are based off of a handful of encounter actors that are used as templates. It seems the most efficient way to get what I want done is to attach the script to the templates and call it a day. The problem is the template actors script box is, while empty, greyed out. Every other skeleton actor has editable scripts, but not these few.

 

I decided to get creative when I noticed that the actors used as templates didn't use any templates themselves. So, I created a dummy actor and attached the script to that, and then went to the template actors and modified them so that they in turn used a template, inheriting scripts from the dummy actor. Saved the mod and went to test it, but no dice. Upon reloading in the creation kit, I look at the dummy actor and discover that its script box is now greyed out (and empty) as well.

 

What's going on? I need to attach this script to these actors but am now out of ideas.

 

If your dummy actor is used by a levelled list, his script box will be disabled. The work-around is to apply the script to a MagicEffect, like elseagoat describes in his/her post.

Also, you can still apply scripts to any actors that use the levelled list as a template.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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