Jump to content

[LE] How do you apply diseases to traps, weapons etc?


Recommended Posts

Hi

 

Does anyone know how to do this?

 

I can see the diseases such as TrapDisDamageMagicka in the object window but can't for the life of me work out how to apply them to traps so that the trap has a chance of infecting the player. I've tried the internet but there seems to be nothing on the subject that I can find. Nor can I see anything in warehouse traps to give me a clue.

Link to comment
Share on other sites

Thanks for the reply FrankFamily,

 

I've played the game a lot and recall getting diseases from swinging blades in Nord dungeons...it's what made me think to do the same in my mod. I'll try loading up a few in CK and see if I can find them. If it involves scripting, I'll probably avoid it since it's way out of my league.

Link to comment
Share on other sites

Thanks Iofgren.

 

All the traps I've looked at have diseases attached to them in the script TrapHitBase but the chance of infecting the player is defaulted to 2.5% and then the disease applied is randomised from all the options. Whether or not they have any chance of transmitting a disease is controlled by the property CanDisease, which is set to false by default. I just need to set this to true.

 

I will make a new version of TrapHitBase and play around with the percentage chance of infection. I may make a couple of more nasty diseases and insert them into the script. I should manage this because it just involves Altering a random integer to increase the number of dideases to choose from and sticking in some more ElseIf statements and adding the properties for the new diseases.

 

My traps already could cause disease, I just hadn't seen where to enable them!

 

with a bit of care I ought to be able to cut most of this script out to make a new one that just does the disease bit. That could then be applied to enemy weapons, I guess.

 

Edit: It shows how good I am with scripts (wry chuckle). Altering the standard spear trap so that the property CanDisease is true resulted in traps that apply the standard diseases. I then duplicated another spear trap (KetilTrapSpear01) and edited the TrapHitBase script, renaming the new script KetilTrapHitBase. All I altered was the chance to cause disease. It compiled, I used autofill properties and assigned this script to my new spear, deleting the original one. Not only did the new spears not cause disease but they stopped doing damage, although the animations ran. Oh, well, at least I know how to get the standard spear trap to cause disease.

 

Edit 2: Okay, so I've done a bit of digging. I noticed that of the two scripts applied to the spear traps, namely SpearTrap and TrapHitBase, the script SpearTrap extends the script MovingTrap, which in turn extends the script TrapBase. in the script TrapBase is this line...

 

TrapHitBase property hitbase auto hidden

 

Is this setting up the property for the script TrapHitBase? If so, then it might explain why my traps don't work properly. 'hitbase' is not used in the animations but is used in the damage and disease calculations. If I'm right, I take it I'd have to write new scripts replacing references to TrapHitBase with KetilTrapHitBase.

 

Edit3: Sorted! I was so pleased I had my character run back and forwards over the pressure plate until He'd contracted all six illnesses.

 

To alter the damage and disease caused by traps four scripts need to be duplicated, renamed and edited. Mine are now as follows:

 

KetilTrapBase extends ObjectReference

KetilMovingTrap extends KetilTrapBase

KetilSpearTrap extends KetilMovingTrap

KetilTrapHitBase extends ObjectReference

 

Only the last two are added to the trap itself. I'm now going to add my own diseases to KetilTrapHitBase and I'm done.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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