Jump to content

Adding an item to the inventory when the player drinks a specific poti


halo4life

Recommended Posts

How would I do this? I'm not good at scripting and I've looked everywhere in the construction set wiki. :wallbash:

You need some kind of activator, potions are themselves activators. Follow something in the line of creating a potion type activator and use the additem function... In this specific case you can just disable the potion instance after the activation.

 

Since I never created a potion this way I'm not sure but the disabling effect maybe even automatic.

Link to comment
Share on other sites

On a completely different track...

 

The general point of potions is, of course, that they bestow Magic Effects on the drinker. For this, we'd start by going under Gameplay/Edit Scripts, selecting Script/New, and choosing "Magic Effect" from the drop-down box in the upper-midde-right. The script in question would go something like...

 

scn MyAdderPotionScript
;scn stands for Scriptname.  Giving the script a name on the first line is necessary.

Begin ScriptEffectStart
;All of a script's "actions" need to take place in a Begin/End block.  Each different type of block runs in different situations.
;ScriptEffectStart blocks only work for Magic Effect scripts, and run when the effect begins.

 AddItem MyPotionItem
;MyPotionItem being whatever item you want the potion to add.
;Since a specific reference isn't being specified to add the item to, it will be added to the potion's drinker.
;If something like "Player.AddItem MyPotionItem" was used instead, the player would always be given the item.
;Even if the player wasn't the one who drank the potion.
end

 

Save this and go back to your potion. In the "Results" list on the right of the potion's window, right-click and select "new". Select "Script Effect" from the "Effect" drop-down box. The Duration should probably be set to 0. Select your new script in the "Script" drop-down box (If it's not on the list, you most likely didn't set it to a Magic Effect), and give it whatever name and/or visual effects you'd like.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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