Jump to content

Recommended Posts

Posted

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

Posted

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

Posted (edited)
  On 6/7/2012 at 3:14 AM, scrivener07 said:
Debug.Notification("I like turtles")

 

ROFL :laugh:

Edited by steve40
Posted (edited)
  On 6/7/2012 at 12:17 PM, chuckmccaw said:

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
Posted
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
Posted (edited)
  On 6/7/2012 at 1:37 PM, chuckmccaw said:

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
Posted
Ok, so i kinda realise i did'nt have no duration and no magnitude ticked, hence the worth being 0 for both, all works grand except that they come out unaggresive. is there any easy way to make them aggresive guys?
Posted (edited)

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
  • Recently Browsing   0 members

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