antstubell Posted September 29, 2012 Share Posted September 29, 2012 So the event is player takes coin purse and a Werewofl appears. This is what I scripted and it compiles. WW01 is EncWerewolf and summoned3 is SummonFXlight. ActorBase property WW01 autoLight property summoned3 auto Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) if (newContainer == Game.GetPlayer()) self.PlaceAtMe(summoned3,1)self.PlaceAtMe(WW01,1) endif EndEvent Something is wrong because Werewolf doesn't appear. Link to comment Share on other sites More sharing options...
steve40 Posted September 29, 2012 Share Posted September 29, 2012 You are trying to place a werewolf at the coin purse ..... which is now in the **player's inventory** :) Link to comment Share on other sites More sharing options...
antstubell Posted September 29, 2012 Author Share Posted September 29, 2012 You are trying to place a werewolf at the coin purse ..... which is now in the **player's inventory** :)Yeah. I just had a nap and thought about thwat the script is doing or trying to do. It's not even a container change as the coin purse isn't in a conatainer. What's the command I'm looking for? Link to comment Share on other sites More sharing options...
steve40 Posted September 30, 2012 Share Posted September 30, 2012 (edited) OnContainerChanged should be fine, I think. Try this. If you get a debug message on the screen, then you will know the script is firing.You should place the werewolf at the player, not at the purse (self = the script on the purse) :) ActorBase property WW01 auto Light property summoned3 auto Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) Debug.Notification("OnContainerChanged just fired.") if (newContainer == Game.GetPlayer()) newContainer.PlaceAtMe(summoned3,1) newContainer.PlaceAtMe(WW01,1) endif EndEvent Edited September 30, 2012 by steve40 Link to comment Share on other sites More sharing options...
antstubell Posted September 30, 2012 Author Share Posted September 30, 2012 OnContainerChanged should be fine, I think. Try this. If you get a debug message on the screen, then you will know the script is firing.You should place the werewolf at the player, not at the purse (self = the script on the purse) :) ActorBase property WW01 auto Light property summoned3 auto Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) Debug.Notification("OnContainerChanged just fired.") if (newContainer == Game.GetPlayer()) newContainer.PlaceAtMe(summoned3,1) newContainer.PlaceAtMe(WW01,1) endif EndEvent Nope, script is not firing, no debug message and no Werewolf. Link to comment Share on other sites More sharing options...
steve40 Posted October 3, 2012 Share Posted October 3, 2012 (edited) OnContainerChanged WILL fire when the coin purse is placed into a container, such as the player's inventory. If it doesn't, then something is wrong. Please post the full script including the script header. I want to see which script you are extending. You are putting the script on the coin purse objectreference in the Render Window, not on a quest alias, right? Edited October 3, 2012 by steve40 Link to comment Share on other sites More sharing options...
antstubell Posted October 3, 2012 Author Share Posted October 3, 2012 OnContainerChanged WILL fire when the coin purse is placed into a container, such as the player's inventory. If it doesn't, then something is wrong. Please post the full script including the script header. I want to see which script you are extending. You are putting the script on the coin purse objectreference in the Render Window, not on a quest alias, right?I put the script on a copy of a coin purse renamed "CoinPurseScripted" in the Object Window. Here is the script. Scriptname SummonWWScript extends ObjectReference ActorBase property WW01 autoLight property summoned3 auto Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer) Debug.Notification("OnContainerChanged just fired.") if (newContainer == Game.GetPlayer()) newContainer.PlaceAtMe(summoned3,1) newContainer.PlaceAtMe(WW01,1) endif EndEvent I've attached 2 screenshots of the Object and Properties. Link to comment Share on other sites More sharing options...
AnkhAscendant Posted October 3, 2012 Share Posted October 3, 2012 (edited) Excuse my intrusion, but mightn't antstubell have been on the right track with "the coinpurse isn't in a container" up there? The coinpurse isn't added to the player's inventory, X amount of gold is, so the purse itself isn't really changing containers, is it? Edited October 3, 2012 by AnkhAscendant Link to comment Share on other sites More sharing options...
antstubell Posted October 3, 2012 Author Share Posted October 3, 2012 Excuse my intrusion, but mightn't antstubell have been on the right track with "the coinpurse isn't in a container" up there? The coinpurse isn't added to the player's inventory, X amount of gold is, so the purse itself isn't really changing containers, is it? That's what I thought. I am a novice scripter basically copying and mashing together scripts from other scripts. I am fluent in old BASIC programming and logic told me that the line "OnContainerChange..." didn't make sense in the context of what's happening. I thank Steve40 for taking the time to reply and I bow to anybody's knowledge tat is greater than mine. Is there an "OnItemAdded" comand or am I just making it up? I really don't know how to script this. Link to comment Share on other sites More sharing options...
reaper9111 Posted October 3, 2012 Share Posted October 3, 2012 GetItemCount, perhaps ? Can probably replace that "OnContainerchange", if you are trying to know when the "Object" is in theinventory... Link to comment Share on other sites More sharing options...
Recommended Posts