Jump to content

How to start a script when a drink is used


ozziefire

Recommended Posts

I have a drink that I am using to trigger the start of a quest when it is consumed. I've tried usin Begin OnEquip and Begin OnOpen with no luck yet.

I have the script in the cola drink, but I only want it to activate when it has been drank. I'm suspecting the OnActivate might work but unclear on how it woks after reading the wiki.

Any clues on this would be great.

Link to comment
Share on other sites

Just use:

 


begin OnActivate

 

What it is talking about, is like if you have nuka-cola and you use it, when you run the begin OnActivate, it will no longer run its normal code block.

Like, you won't get the hp healing from it or the decrease in dehydration.

Link to comment
Share on other sites

Remove the script from the ingestible

Create a base effect with type script, on self.

Create an effect script for it and just use the scripteffectStart block - it will run exactly once.

Add the base effect to the ingestible with no duration

Link to comment
Share on other sites

Just use:

 


begin OnActivate

 

What it is talking about, is like if you have nuka-cola and you use it, when you run the begin OnActivate, it will no longer run its normal code block.

Like, you won't get the hp healing from it or the decrease in dehydration.

you can easily get around that with

begin OnActivate
    ; your code
    activate
end

this will first run your code and then the objects normal activation.

plus, if you're using activate as a script command, you can choose the kind of activation yourself, activate 1 under all circumstances runs your onActivate block, activate 0 under all circumstances runs the normal activation, ignoring any onActivate block. plus you can set the action ref, like activate player 1 runs the objects OnActivate block with the player as the action reference.

 

but anyway, onActivate wouldn't work here, it goes just like rickerhk said.

Link to comment
Share on other sites

Remove the script from the ingestible

Create a base effect with type script, on self.

Create an effect script for it and just use the scripteffectStart block - it will run exactly once.

Add the base effect to the ingestible with no duration

Thanks Mate this did a bonza job of fixing it, all is good :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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