Laerithryn Posted November 8, 2020 Share Posted November 8, 2020 I have an object in creation kit that I want to assign an area of damage to. To be clear, I want either the object itself or the area it resides in give damage to the player character. Anyone know how to achieve this? Link to comment Share on other sites More sharing options...
cumbrianlad Posted November 8, 2020 Share Posted November 8, 2020 If it's a static object, you can just add a trigger box or even a primitive (collision cube or collision sphere), add a script to it such as BWClightDamageScript, set your properties, size the box and if the player enters it their health will start dropping. A collision sphere would be nice for this. Centre the box/primitive at the same place as your object in CK. I don't know how to assign proximity damage to an object without using the method I've stated, but it's dead simple to do it this way in CK and it's how Beth did all the light and lave damage. If it's an interactible object (activator), it will need a script. I.e. if it damages the player until they reach it and 'turn it off'. That's pretty simple too. Just do what I said before and add a script to the activator to disable the collision object that's doing the damage. Hope that helps. Link to comment Share on other sites More sharing options...
Laerithryn Posted November 9, 2020 Author Share Posted November 9, 2020 If it's a static object, you can just add a trigger box or even a primitive (collision cube or collision sphere), add a script to it such as BWClightDamageScript, set your properties, size the box and if the player enters it their health will start dropping. A collision sphere would be nice for this. Centre the box/primitive at the same place as your object in CK. I don't know how to assign proximity damage to an object without using the method I've stated, but it's dead simple to do it this way in CK and it's how Beth did all the light and lave damage. If it's an interactible object (activator), it will need a script. I.e. if it damages the player until they reach it and 'turn it off'. That's pretty simple too. Just do what I said before and add a script to the activator to disable the collision object that's doing the damage. Hope that helps. Greatly appreciate the response, and I'll have to give that a try. At the moment my object is a simple one you can pickup and place in your inventory and drop as any normal object. But I would like for it to have the player take damage the closer they get. As you mentioned above, proximity damage. Eventually, when the player actually closes the gap of distance (by having the right key or item in their inventory) to reach the object, I would like to make the object destructible in order to destroy it. For now I'll have to try your suggestions, thanks again! Link to comment Share on other sites More sharing options...
cumbrianlad Posted November 11, 2020 Share Posted November 11, 2020 No probs. The area I was thinking of is in the Thieves' Guild quests at the temple (to get the skeleton key). If you look at it, all Beth did was to place 2 collision cubes inside each other. The first does less damage, the smaller inside cube does more damage. That's why health drops slowly for a time and then the drop suddenly increases... the player has entered the inside collision cube. Not Ideal, I know. If you are like me you want the health drop to progressively increase with each step the player makes... I'm afraid I don't know how to do that. Anyway, hope it's going OK for you. Link to comment Share on other sites More sharing options...
Laerithryn Posted November 12, 2020 Author Share Posted November 12, 2020 No probs. The area I was thinking of is in the Thieves' Guild quests at the temple (to get the skeleton key). If you look at it, all Beth did was to place 2 collision cubes inside each other. The first does less damage, the smaller inside cube does more damage. That's why health drops slowly for a time and then the drop suddenly increases... the player has entered the inside collision cube. Not Ideal, I know. If you are like me you want the health drop to progressively increase with each step the player makes... I'm afraid I don't know how to do that. Anyway, hope it's going OK for you. Ok again, very much appreciated. I'll have to settle for the collision cubes in your suggestion. As you stated, not ideal, but will work in a pinch which is where I'm at currently. Just want to get it all done so I can upload the mod finally and take a break from it. I'm at the point where I'm starting not to care as this has been a huge learning curve for me. Link to comment Share on other sites More sharing options...
antstubell Posted November 12, 2020 Share Posted November 12, 2020 If this helps I wrote a script that causes damage when player enters a trigger box. The damage takes into account the player's level and stamina damage is an optional bool property. For what you asked about - having increased level of damage when player nears an object, then place a series of trigger boxes with increasing damage values. Actor Property PlayerREF AutoFloat Property HDamValLvl1_10 AutoFloat Property HDamValLvl11_29 AutoFloat Property HDamValLvl30_49 AutoFloat Property HDamValLvl50plus AutoFloat Property SDamageValue AutoBool Property DoesDamageStamina = False AutoEVENT onTrigger(ObjectReference akActionRef)if akActionRef == PlayerRefIf PlayerRef.GetLevel() <= 10PlayerREF.DamageActorValue("Health", HDamValLvl1_10)EndIfIf PlayerRef.GetLevel() > 10 && PlayerRef.GetLevel() < 30PlayerREF.DamageActorValue("Health", HDamValLvl11_29)EndIfIf PlayerRef.GetLevel() >= 30 && PlayerRef.GetLevel() <= 49PlayerREF.DamageActorValue("Health", HDamValLvl30_49)EndIfIf PlayerRef.GetLevel() >= 50PlayerREF.DamageActorValue("Health", HDamValLvl50plus)EndIfIf DoesDamageStamina == TrueStaminaDamage()EndIfendifENDEVENTFunction StaminaDamage();debug.notification("Stamina Damage Function")PlayerREF.DamageActorValue("Stamina", SDamageValue)EndFunction Link to comment Share on other sites More sharing options...
Laerithryn Posted November 14, 2020 Author Share Posted November 14, 2020 If this helps I wrote a script that causes damage when player enters a trigger box. The damage takes into account the player's level and stamina damage is an optional bool property. For what you asked about - having increased level of damage when player nears an object, then place a series of trigger boxes with increasing damage values. Actor Property PlayerREF AutoFloat Property HDamValLvl1_10 AutoFloat Property HDamValLvl11_29 AutoFloat Property HDamValLvl30_49 AutoFloat Property HDamValLvl50plus AutoFloat Property SDamageValue Auto Bool Property DoesDamageStamina = False Auto EVENT onTrigger(ObjectReference akActionRef)if akActionRef == PlayerRefIf PlayerRef.GetLevel() <= 10PlayerREF.DamageActorValue("Health", HDamValLvl1_10)EndIf If PlayerRef.GetLevel() > 10 && PlayerRef.GetLevel() < 30PlayerREF.DamageActorValue("Health", HDamValLvl11_29)EndIf If PlayerRef.GetLevel() >= 30 && PlayerRef.GetLevel() <= 49PlayerREF.DamageActorValue("Health", HDamValLvl30_49)EndIf If PlayerRef.GetLevel() >= 50PlayerREF.DamageActorValue("Health", HDamValLvl50plus)EndIf If DoesDamageStamina == TrueStaminaDamage()EndIf endifENDEVENT Function StaminaDamage();debug.notification("Stamina Damage Function")PlayerREF.DamageActorValue("Stamina", SDamageValue)EndFunction Truly awesome of you Antstubell. Very much appreciated! Now to figure out how to implement your script. Link to comment Share on other sites More sharing options...
Laerithryn Posted November 15, 2020 Author Share Posted November 15, 2020 If this helps I wrote a script that causes damage when player enters a trigger box. The damage takes into account the player's level and stamina damage is an optional bool property. For what you asked about - having increased level of damage when player nears an object, then place a series of trigger boxes with increasing damage values. Actor Property PlayerREF AutoFloat Property HDamValLvl1_10 AutoFloat Property HDamValLvl11_29 AutoFloat Property HDamValLvl30_49 AutoFloat Property HDamValLvl50plus AutoFloat Property SDamageValue Auto Bool Property DoesDamageStamina = False Auto EVENT onTrigger(ObjectReference akActionRef)if akActionRef == PlayerRefIf PlayerRef.GetLevel() <= 10PlayerREF.DamageActorValue("Health", HDamValLvl1_10)EndIf If PlayerRef.GetLevel() > 10 && PlayerRef.GetLevel() < 30PlayerREF.DamageActorValue("Health", HDamValLvl11_29)EndIf If PlayerRef.GetLevel() >= 30 && PlayerRef.GetLevel() <= 49PlayerREF.DamageActorValue("Health", HDamValLvl30_49)EndIf If PlayerRef.GetLevel() >= 50PlayerREF.DamageActorValue("Health", HDamValLvl50plus)EndIf If DoesDamageStamina == TrueStaminaDamage()EndIf endifENDEVENT Function StaminaDamage();debug.notification("Stamina Damage Function")PlayerREF.DamageActorValue("Stamina", SDamageValue)EndFunction Ok... I tried to input your script Antstubell on a trigger box, unfortunately it CTD every time I try it. Any ideas? Link to comment Share on other sites More sharing options...
Laerithryn Posted November 15, 2020 Author Share Posted November 15, 2020 I cant figure it out Antstubell, so in the mean time I fall back on Cumbrianlad's suggestion of simply using the BWClightDamageScript which works fine. Again, thank you for your effort and time just the same. Now I just need to figure out how to make my object destructible. Then figure out how to replace the nif it uses for appearance with an alternate one showing the deactivated or destroyed state once it is destroyed. Is it possible to give an object health points like a character? I wonder if an actor can use an object for its image or appearance, that would solve that issue? Link to comment Share on other sites More sharing options...
Laerithryn Posted November 15, 2020 Author Share Posted November 15, 2020 Also, new problem, how to remove the trigger box once the object has been destroyed? Link to comment Share on other sites More sharing options...
Recommended Posts