Jump to content

Poison Delays - help required


markyboy444

Recommended Posts

I would really like to add an extra piece of functionality to my mod - which revolves around poisoned foods, by implementing a timer before the poison is activated (once placed inside of the targets inventory.)

It's kinda been requested by a few people because if your an assassin/hitman you get that extra sense of immersion from watching your enemy die from a distance.

I'm a little unsure on how to do this (scripting with skse or whatever i need to use) but if anyone could guide me I would be really grateful! :smile:

 

Many thanks,

Mark

Link to comment
Share on other sites

Part psuedo code cause I don't know what you have. Variables will be written to be self-explanatory.

 

On whatever script you use to give the poisoned foods to the NPC...

 

Immediately after the AddItem line:

RegisterForSingleUpdate(PoisonDelayTime)

 

New event to add:

Event OnUpdate()

PoisonedFood.Activate(TargetActor)

EndEvent

 

PoisonDelayTime <-- This is the time you want the poison to delay

PoisonedFood <-- This is the poisoned food you want activated after the delay

TargetActor <-- This is the NPC that was given the poisoned food.

 

 

This of course assumes that you can easily obtain the target actor. It is assumed so because based on your statements you already have a means of giving the items to the NPC.

 

At any rate, what you are looking at using are the RegisterForSingleUpdate function and the OnUpdate event. You could also use the RegisterForSingleUpdateGameTime function with the OnUpdateGameTime event if you want to deal in game time as opposed to real time. None of which are SKSE.

Link to comment
Share on other sites

Hi, i just found my poison script that i use to Apply poison to npcs,

I'm kinda a bit stuck as i am unsure of how to implement the timer into my existing code

I tried but it didn't want to compile -

http://imgur.com/rUeDBau

 

Update/edit* - I've got it compiling with some functions but i'm unsure of where to put the update event..

http://imgur.com/9DKfgRb

Edited by markyboy444
Link to comment
Share on other sites

Now you have me confused. Is this to affect the player or to affect NPCs? It would also be helpful to see the whole script. What does the effect do? If the poison is already applied in this effect it is too late.

 

The way I see it working with a magic effect, if the magic effect itself provides the poison:

 

food/potion > food/potion used > Magic effect # 1 with timer script > Time up, cast spell > Magic effect # 2 with poison effect

 

Or

 

playable food/potion > playable food/potion used > Magic effect #1 with timer script > Time up, activate non-playable food/potion > Magic effect #2 with poison effect.

 

The scripting for both would be:

 

 

Spell Property PoisonSpell Auto
Actor MyTarget
 
Event OnEffectStart(Actor Target, Actor Caster)
  MyTarget = Target
  RegisterForSingleUpdate(5.0)
EndEvent
 
Event OnUpdate()
  PoisonSpell.Cast(MyTarget,MyTarget)  ;has the target cast a self target spell which applies poison damage
EndEvent

Or

Potion Property PoisonPotion Auto
Actor MyTarget

Event OnEffectStart(Actor Target, Actor Caster)
  MyTarget = Target
  RegisterForSingleUpdate(5.0)
EndEvent
 
Event OnUpdate()
  PoisonPotion.Activate(MyTarget) ;causes the target to use a potion that will apply a poison effect to the target
EndEvent

 

 

 

This is just a starting point, you'll have to figure it out from here. I've no idea how to set up any of the actual effects involved. This is just what makes the most sense.

Edited by IsharaMeradin
Link to comment
Share on other sites

If you use the above script, you need to store the Target actor for that script as an Actor property, and where Target (in Ishara's PoisonPoison.Activate (Target)) is called within the update and replace the word Target with the name of your property [since after OnEffectStart's target data terminates after the event call] Edited by Arron Dominion
Link to comment
Share on other sites

If you use the above script, you need to store the Target actor for that script as an Actor property, and where Target (in Ishara's PoisonPoison.Activate (Target)) is called within the update and replace the word Target with the name of your property [since after OnEffectStart's target data terminates after the event call]

I didn't even see that... too busy wanting to help that I forgot about the variable not carrying over to other events... I'll correct the post.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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