davidlallen Posted January 26, 2011 Share Posted January 26, 2011 I have a recipe which creates an item. The item has a script. The script has an "onadd player" block so I can trigger some stuff to happen when the item is created. However, I get the item in my inventory without the script triggering, which seems wrong. If I "player.additem" the item at the console, then the script triggers, so I know the script is right. Is there another way to be notified when a recipe is finished? Link to comment Share on other sites More sharing options...
rickerhk Posted January 26, 2011 Share Posted January 26, 2011 I think there is a bug where scripts don't run on crafted items. Link to comment Share on other sites More sharing options...
davidlallen Posted January 26, 2011 Author Share Posted January 26, 2011 That is annoying. Can you think of another way to do this? Link to comment Share on other sites More sharing options...
baduk Posted January 26, 2011 Share Posted January 26, 2011 U should try sending pm to puce moose cause he always is making cool stuff with crafted items. Link to comment Share on other sites More sharing options...
MadNuttah Posted January 26, 2011 Share Posted January 26, 2011 Hey, what kind of object is that? Might an object/actor effect with a corresponding script does the trick? I've had a similar case yesterday, so I'm may able to help. I'm willing to send you my scripts for comparison, if you want. :) Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted January 26, 2011 Share Posted January 26, 2011 You could run a gamemode script that checks to see if it's in your inventory. Link to comment Share on other sites More sharing options...
davidlallen Posted January 26, 2011 Author Share Posted January 26, 2011 Thanks for the suggestions. I'd rather avoid a gamemode script on the player, since it will run every frame. For this particular object, it makes sense for it to be very heavy (like 300 pounds). I assume that for most players it will be enough to make them immobile, and they will immediately drop it. It should be possible to trigger on the "drop" action to do what I want. If that doesn't work I will come back. Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted January 26, 2011 Share Posted January 26, 2011 You could make it a specific bench, and then put a trigger in that cell, and then instead of gamemode you could use OnTrigger. Link to comment Share on other sites More sharing options...
davidlallen Posted February 6, 2011 Author Share Posted February 6, 2011 (edited) Thanks for the suggestions. None of them work. It doesn't seem like this should be so hard. Can you help? My goal is to have a script run, when the player creates an item at any workbench (not one particular workbench). I have tried "onadd" for the item, I have tried "gamemode" for the item. Neither of them is triggered when the item is created. Both of them are triggered if the player picks up the item, so I know the scripts work. I have also tried "ondrop" of one of the recipe input items, conditioned on "if menumode 1077". That doesn't trigger either. Please find attached a tiny test mod. It has a free recipe, xyzrecipe, which converts one stimpack into one xyzstimpack. There is a script, xyzscript, attached to xyzstimpack. It has an onadd and gamemode block, each of which will put up a simple message box when they trigger. In geck, you can filter with "xyz" to see all these objects. Please load the mod, go to a workbench, and convert one stimpack into an xyzstimpack. Notice that no message boxes appear. Now drop the xyzstimpack and pick it up. *Now* both of the message boxes appear. If you can suggest a different approach, or show a working script, I would greatly appreciate it. Edited February 6, 2011 by davidlallen Link to comment Share on other sites More sharing options...
rickerhk Posted February 7, 2011 Share Posted February 7, 2011 Since scripts don't run on crafted items, you are stuck with a work-around. The only work-around I can think of is a script to monitor the Player's inventory for the crafted item, then replace it with another item (or maybe the same item so the script will run). A quest script that runs every second or so. Edit - probably a different item so your quest script can tell the difference if there are multiples. Link to comment Share on other sites More sharing options...
Recommended Posts