YourUnequal Posted January 27, 2013 Share Posted January 27, 2013 OK I'm hoping people will be kind especially since I'm new to Papyrus and only really started learning how to do it a few days ago because I wanted to make an immersive health mod which gradually applies stronger Imods based on the character's health. Since there was no existing papyrus script that seems to link to the game in the CK relating to the 'LowHealthImod' I decided I should try and make my own script from scratch. As a result, what I have is a hidden quest which starts on load (since that also seems to be the only way I can get a papyrus script to be running all the time and not as a result of something happening) and attached to that quest is a script. The problem is that I get an error when trying to compile the script. This also means I can't test it since it doesn't generate an output. So with that said, this is what I have so far: Scriptname HealthStagesImods extends Quest Hidden {Script Supporting various health level fades.} ImageSpaceModifier Property HealthEightyPercent Auto ImageSpaceModifier Property HealthSixtyPercent Auto ImageSpaceModifier Property HealthFourtyPercent Auto ImageSpaceModifier Property HealthTwentyPercent Auto float Property PercentHealth = 100.0 Auto PercentHealth = GetTargetActor().GetAVPercentage("Health") ; ; debug.trace(self + " Enter Bleedout"); While PercentHealth < 1 If PercentHealth <= 0.8 HealthEightyPercent.ApplyCrossFade(0.2) ElseIf PercentHealth <= 0.6 HealthSixtyPercent.ApplyCrossFade(0.2) ElseIf PercentHealth <=0.4 HealthFourtyPercent.ApplyCrossFade(0.2) ElseIf PercentHealth <=0.2 HealthTwentyPercent.ApplyCrossFade(0.2) EndIf EndWhile Generally I want a fade between Imods of varying strength at increments of 20% health. When I try to compile the script, this is the error I receive: C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\HealthStagesImods.psc(9,14): no viable alternative at input '=' So whether or not this script is even remotely right is beyond me; I might not even be going about this the right way (attaching a script to a quest which is always active) and the script might not even work when I run the game. All I would ask is if anyone has any advice they can give me on how to go about accomplishing this or any alternative ways of having a papyrus script that just runs in the background while the game is running on a continuous loop (the example that comes to mind is that there must be some code somewhere in the game which is always running and tells the game to apply the LowHealthImod once health is <= 20% and continues to play it until health >20%) I would appreciate it greatly; it would also give me a chance to enrich my knowledge of Papyrus. This is a steep learning curve for me and for anyone who thinks that scripting something like this would be easy, then you have my respect. But be gentle :blush: Thanks (for taking the time to read all this, mostly!) YourUnequal Link to comment Share on other sites More sharing options...
Recommended Posts