Jump to content

Scripting Question


chuckmccaw

Recommended Posts

So I've been through this a lot, from modding almost all ends of skyrim for my mod, i am once again stuck by the infection script, it is:

A Disease effect and is already distributed

A magic effect which is scripted with the following:

 

Scriptname WalkingDeadInfection extends ActiveMagicEffect

Faction Property FactionAdding  Auto  
Race Property SetRace  Auto

Event OnEffectFinish(Actor akTarget, Actor akCaster)
       If (akTarget.IsDead() == 1)
	akTarget.Resurrect()
		akTarget.SetRace(SetRace)
	akTarget.RemoveFromAllFactions()
            	akTarget.AddToFaction(FactionAdding)
	akTarget.StartCombat(Game.GetPlayer())
       Endif
EndEvent

 

The problem is, in game nothing happens, they catch the disease, get killed and thats that

Link to comment
Share on other sites

Try Event OnEffectStart(). If your effect is constant it may never finish. Also, adding a Debug.x() to your scripts can help follow a script in game as it runs.

Scriptname WalkingDeadInfection extends ActiveMagicEffect

Faction Property FactionAdding  Auto  
Race Property SetRace  Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
Debug.Notification("I like turtles")
       If (akTarget.IsDead() == 1)
Debug.Notification("Npc Infected")
               akTarget.Resurrect()
               akTarget.SetRace(SetRace)
               akTarget.RemoveFromAllFactions()
               akTarget.AddToFaction(FactionAdding)
               akTarget.StartCombat(Game.GetPlayer())
       Endif
EndEvent

Link to comment
Share on other sites

but surely that will only check if there dead when the effect first starts

 

Did you try scrivener07's suggestions though? As I read it, there were two important parts:

 

1. Putting in some debug messages so you can see what's happening. Really hard to work with a script if you don't have any clue what's happening... and maybe, it's not even getting called!

 

and

 

2. >Try Event OnEffectStart(). If your effect is constant it may never finish.

Did you get the part about maybe your event isn't getting called because it may not have finished?

 

So combine the approach and find out what's really going on.

Edited by Sollar
Link to comment
Share on other sites

I tried the above, nothing happens, i dont even get a message about the turtles :/ i fear that spell effects dont continue after death, i'm looking into soultraps script, as it does have an on death effect, but i cant decipher it
Link to comment
Share on other sites

I tried the above, nothing happens, i dont even get a message about the turtles :/ i fear that spell effects dont continue after death, i'm looking into soultraps script, as it does have an on death effect, but i cant decipher it

 

Make sure that you have ticked the "NoDeathDispel" checkbox on your MagicEffect.

If you aren't liking turtles then your spell isn't actually getting cast.

Edited by steve40
Link to comment
Share on other sites

You can use AddToFaction to add them to any of the enemies factions, like bandits and so:

http://www.creationkit.com/AddToFaction_-_Actor

 

To make him enemy of a certain faction use SetEnemy:

http://www.creationkit.com/SetEnemy_-_Faction

 

If you only want them to be aggresive to a specific actor use SetRelationshipRank:

http://www.creationkit.com/SetRelationshipRank_-_Actor

 

If you want everyone to attack this actor on sight use SetAttackActorOnSight, this will probably turn him hostile to everyone who is attacking him(haven't tried this one myself):

http://www.creationkit.com/SetAttackActorOnSight_-_Actor

 

 

You probably want them to be aggresive too so they don't run away like cowards, use SetActorValue for this and change aggression and confidence (I think):

http://www.creationkit.com/SetActorValue_-_Actor

Edited by pauderek
Link to comment
Share on other sites

  • Recently Browsing   0 members

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