Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts



scriptname Barrier extends ObjectReference


Actor Property PlayerRef auto
float playerbarrier
float currenthealth


Event OnCombatStateChanged(Actor akTarget, int aeCombatState)


currenthealth = PlayerRef.GetActorValue("Health")


if aeCombatState==1


playerbarrier=PlayerRef.GetBaseActorValue("Health")/100*50
debug.messagebox(playerbarrier)
else
playerbarrier=0


endif
endevent




Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)


if playerbarrier>0 && PlayerRef.GetActorValue("Health") < currenthealth
debug.messagebox(playerbarrier)
PlayerRef.RestoreActorValue("Health",currenthealth-PlayerRef.GetActorValue("Health"))
playerbarrier= playerbarrier - (currenthealth - PlayerRef.GetActorValue("Health"))


endif


endevent



This script does not run at all.

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Alright, different question.

 

I'm trying to take advantage of Skyrim's blood impact effects. What they do natively is find a surface to plop down big ugly blood textures, while simultaneously causing a spurting effect at wherever the texture lands.

 

I have already made a slight mod to the impact effect's mesh so that the direction it spurts remains consistent (originally it has a kind of variability to it). The problem here is that I need the blood to spurt from, you know, a body, but the impact effect is not designed to land on a body. So this causes two problems: First, the direction of the spurt is dictated by basically the ground, so it's always up. Second, the origin of the spurt is, again, the ground, which basically makes it unusable.

 

I'm not really after trying to get the texture to land on the body; I already know that this cannot be done with an impact effect, and that there are other ways of achieving it. But I am very much wanting the blood spurt to occur where I specifically want it to on the body - not from the ground.

 

What should I be doing to achieve this?

Link to comment
Share on other sites

Yes.

 

Little warning about OnHit. It is processed every time something is hit. Not just what you have it scripted to look for.

 

If the player is hit by many things at once, this could cause some problems. Perhaps you could use a STATE to have OnHit run once if you don't need it more then once.

Edited by Terra Nova
Link to comment
Share on other sites

Don't misunderstand. OnHit works as intended. But your script basically will do all of that checking for every kind of attack. BUT if you script it to run code ONLY if the player is hit by a spell, then that code will run, AND if they are hit by something else, the Event is still sent, but the code for the spell check is not ran. I hope I explained that well enough.

Link to comment
Share on other sites

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked )


count=count+1


if PlayerRef.GetRace()!=NordRaceVampire || PlayerRef.GetRace()!=ArgonianRaceVampire || PlayerRef.GetRace()!=BretonRaceVampire || PlayerRef.GetRace()!=DarkElfRaceVampire || PlayerRef.GetRace()!=HighElfRaceVampire || PlayerRef.GetRace()!=ImperialRaceVampire || PlayerRef.GetRace()!=KhajitRaceVampire || PlayerRef.GetRace()!=RedguardRaceVampire || PlayerRef.GetRace()!=WoodElfRaceVampire|| PlayerRef.GetRace()!=OrcRaceVampire || PlayerRef.GetRace()!= ElderRaceVampire
if count == 5
PlayerRef.RestoreActorValue("Health",PlayerRef.GetBaseActorValue("Health")/100*10)
count=0
endif
endif
endevent

This event keeps happening EVEN if I change race to a vampire and it really ticks me off, I can't figure out WHY it does that, the script is attached directly to the player.

The condition is clear too, logical to me, if you are that race then that IF should NOT happen, YET IT STILL DOES.

Edited by Kerberus14
Link to comment
Share on other sites

Is there a way to tell when an animation finishes?

 

Example: Player.DrawWeapon(). I want to hold off doing anything else until the drawing animation completes. (In this case, the game understandably believes the weapon is drawn the moment the animation starts.) Since the timing of this can be variable, I cannot simply wait an arbitrary X seconds.

 

One of my last several questions will get an answer. :p

Link to comment
Share on other sites

Alright, I need to pin this one down once and for all.

 

My mod causes certain visual effects on NPCs around the player. I achieve this through the use of a spell & effect. I have made note of the fact that when the player changes locations, any NPC they happen to have left behind (even if it was for just a split second, such as a follower) loses the spell, triggering the OnEffectFinish.

 

There has to be a well-known method of dealing with this. After all, spells can't just disappear from followers just because the player is entering a cave or whatever.

 

For the time being, I am just having the spell re-apply itself whenever this happens. Again, there really has to be a better way.

 

Note!: I will not use aliases for this. This effect has to be able to be applied to any and every NPC, transparently, without having to set up a dozen+ aliases and juggle those.

 

If your cloak parameter spell has a concentration delivery type it should be reapplied every second. Is that not fast enough for you? Using cloak spells is pretty much the primary method for dealing with the situation you describe, but the effect will still be removed from followers if they leave the player's aura. It will just get reapplied instantly when they reenter it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...