glad0s98 Posted March 7, 2013 Share Posted March 7, 2013 So im making custom armor thats kinda like nanosuit from crysis. I need help scripting sounds for it. I need script to play different sounds in these conditions: Player has equipped nanosuit AND . -- player has 75% health left . -- player has 50% health left . -- player has 25% health left . -- player dies . -- player enters combat - player equips nanosuit - player unequips nanosuit I also need to do magic effect that constantly drains magicka while active and disappears when magicka bar is empty. And also, how do you increase player's jump height with spell? I know im asking (maybe) too much, but help is appreciated! :) Link to comment Share on other sites More sharing options...
sixpak Posted March 8, 2013 Share Posted March 8, 2013 Just going to track this topic. I'm also interested in getting it so certain abilities slowly drain magicka and then dissapear once out of magicka. Just adding the effect 'damage magicka' and setting it to 1 works pretty good to slowly drain magicka as it effective blocks any magicka regen. But no idea how to make the spell shut off, I guess it'll need to be scripted effect. Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 I think I can help with the 75%, 50%, 25% stuff. On the armor piece, you could try a script like: float Property UpdateInterval auto Sound Property Sound01 auto Sound Property Sound02 auto Sound Property Sound03 auto int PlayerMaxHealth = 100 player = Game.GetPlayer() Event OnEquipped(Actor akActor) if akActor == player PlayerMaxHealth = akActor.GetAV("Health") RegisterForUpdate(UpdateInterval) endif endEvent Event OnUpdate() if (player.GetAV("Health") / PlayerMaxHealth) <=0.75 && (player.GetAV("Health") / PlayerMaxHealth) > 0.5 Sound01.Play(player) elseif (player.GetAV("Health") / PlayerMaxHealth) <=0.5 && (player.GetAV("Health") / PlayerMaxHealth) > 0.25 Sound02.Play(player) elseif (player.GetAV("Health") / PlayerMaxHealth) <= 0.25 Sound03.Play(player) else ;do nothing endif endEvent Event OnUnequipped(Actor akActor) UnregisterForUpdate() endEvent I believe that this should work, but I'll test it first. Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 Cool! Unfortunately, i cant access creation kit till saturday so i cant try it out. (i'm on vacation) :S Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 Scratch that; not yet working. Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 well i found this: float playersHealth = Game.GetPlayer().GetActorValuePercentage("health") Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 I also tried doing that myself: HealthsoundsSkript extends ObjectReference SOUND property 75%sound auto float playersHealth = Game.GetPlayer().GetActorValuePercentage("health") Event if (Game.GetPlayer().IsEquipped()) if (playersHealth = 0.75) int Function Play(75%sound) Endevent Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 Now, it's working (as far as the Creation Kit is able to compile it): Scriptname TestArmorScript001 extends ObjectReference float Property UpdateInterval auto ;probably best to set it to 1 or longer Sound Property SoundEquip auto ;the sound that plays on equipping the item Sound Property Sound01 auto ;the sound that plays if the player has between 0.50 and 0.75 health Sound Property Sound02 auto ;the sound that plays if the player has between 0.25 and 0.50 health Sound Property Sound03 auto ;the sound that plays if the player is below 0.25 health Sound Property SoundUnequip auto ;the sound that plays on unequipping the item float PlayerMaxHealth = 100.0 Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() SoundEquip.Play(Game.GetPlayer()) PlayerMaxHealth = akActor.GetAV("Health") RegisterForUpdate(UpdateInterval) endif endEvent Event OnUpdate() if (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) <=0.75 && (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) > 0.5 Sound01.Play(Game.GetPlayer()) elseif (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) <=0.5 && (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) > 0.25 Sound02.Play(Game.GetPlayer()) elseif (Game.GetPlayer().GetAV("Health") / PlayerMaxHealth) <= 0.25 Sound03.Play(Game.GetPlayer()) else ;do nothing endif endEvent Event OnUnequipped(Actor akActor) UnregisterForUpdate() SoundUnequip.Play(Game.GetPlayer()) endEvent I'm not sure if you wanted it, but this script will continuously play those sounds at the interval set by "UpdateInterval" if the criteria is met. Link to comment Share on other sites More sharing options...
BrotherBob Posted March 8, 2013 Share Posted March 8, 2013 And, of course, just neglect the first line of the script; paste everything else and set the properties as you would like and everything should be fine. Link to comment Share on other sites More sharing options...
glad0s98 Posted March 8, 2013 Author Share Posted March 8, 2013 well actually i wanted one sound to play when health is xx%. For example: players health drops to 75%, sound that says "health 75%" plays. Link to comment Share on other sites More sharing options...
Recommended Posts