Hi all.
I'm in the process of making tree stumps produce resources i.e. logs. So far I've made a tree stump into an activator which when activated gives 1 chopped log once only (obviously they can't respawn). The script worked fine, then I thought I should do an inventory check to make the player possess a Woodcutter's Axe, so I added more lines to the script - unsuccessfully. The script compiles but no log is added to the player's inventory, no notification either whereas previous to me adding the extra lines all worked well. If you guys could look over the script and tell me what is wrong it will be appreciated. Also I'd like that after the tree has been "harvested" it disables and it replaced by a smaller stump (which is on the right in the screenshot), I guess 2 Object references might work but can the stump disable itself?
Screenshot: https://onedrive.live.com/?cid=b60c11d037429d8e#cid=B60C11D037429D8E&id=B60C11D037429D8E%2130657&v=3
Actor property PlayerRef AutoMiscObject Property CutLog AutoWeapon Property WoodAxe AutoAuto State NotEntered Event OnActivate(objectreference akActionRef) if (PlayerRef.GetItemCount(WoodAxe) > 0) Game.GetPlayer().AddItem(CutLog, 1, False) elseif (PlayerRef.GetItemCount(WoodAxe) == 0)debug.Notification("You need a Woodcutter’s Axe to chop the tree") GoToState("") endif EndEvent EndState
Thanks.