Object Scripts on crafted item

Post » Fri May 27, 2011 12:00 pm

Hi, i'm modding FNV, and, being a programmer, i'm especially getting along with scripts. I don't think this question has been answered, and as crafting/recipes are quite new in NV, i'm not looking on FO3/GECK forums.

I've got some problems with scripts being applied on crafted items..

This is the scenario :
- I create a new weapon, don't put any stat on it, no model/icon either, not the point.
- I create an Object Script on top of it, with only an OnEquip block, showing a dummy Message when the item is equipped.
- I make a RECIPE with this particular weapon as Output.

Now this is where i got troubles. In game, i'm crafting my weapon, it shows in my inventory, I equip it, and.... nothing. Msg don't show, script don't run. Now I throw my weapon out of my inventory, pick it up again, and that's it, the script is working when I now equip the weapon.

I tested some other ways to do the same thing I want, like : having a quest always running, checking if Player has this WeaponID in his inventory (with a Begin Menumode and GetItemCount). He doesn't, until i throw it and pick it up again. Also checked if OnAdd was working instead of OnEquip, not the case either. And so on....

Yea so.. Anyone knows why it's doing this? Why crafted weapons don't execute scripts until I get rid of them and take them again?

Thanks! This is for my Bear Trap mod, as some people have been asking me to make them craftable :).
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Fri May 27, 2011 11:22 am

Hi, i'm modding FNV, and, being a programmer, i'm especially getting along with scripts. I don't think this question has been answered, and as crafting/recipes are quite new in NV, i'm not looking on FO3/GECK forums.

I've got some problems with scripts being applied on crafted items..

This is the scenario :
- I create a new weapon, don't put any stat on it, no model/icon either, not the point.
- I create an Object Script on top of it, with only an OnEquip block, showing a dummy Message when the item is equipped.
- I make a RECIPE with this particular weapon as Output.

Now this is where i got troubles. In game, i'm crafting my weapon, it shows in my inventory, I equip it, and.... nothing. Msg don't show, script don't run. Now I throw my weapon out of my inventory, pick it up again, and that's it, the script is working when I now equip the weapon.

I tested some other ways to do the same thing I want, like : having a quest always running, checking if Player has this WeaponID in his inventory (with a Begin Menumode and GetItemCount). He doesn't, until i throw it and pick it up again. Also checked if OnAdd was working instead of OnEquip, not the case either. And so on....

Yea so.. Anyone knows why it's doing this? Why crafted weapons don't execute scripts until I get rid of them and take them again?

Thanks! This is for my Bear Trap mod, as some people have been asking me to make them craftable :).


Experiencing the exact same issue with adding items from a vendor, the script wont start until i drop the item on the floor and pick it up, searching for an answer/workaround for this too.
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

Post » Fri May 27, 2011 1:48 pm

I think it's just a bug, it even happens on default content for me (the bulk energy ammo).
User avatar
Alex [AK]
 
Posts: 3436
Joined: Fri Jun 15, 2007 10:01 pm

Post » Fri May 27, 2011 11:02 am

I think it's just a bug, it even happens on default content for me (the bulk energy ammo).


Pretty major bug, it seems to be the same one that affects the caravan cards not moving into the caravan deck. Im abit worried that im gonna continue making a mod only to run into more problems later but this one is particular limits mods quite significantly imo, even the Begin gamemode wont solve this issue. not tested the other scripting functions yet but im hoping OnActivate doesnt suffer any bugs.
User avatar
Kerri Lee
 
Posts: 3404
Joined: Sun Feb 25, 2007 9:37 pm


Return to Fallout: New Vegas