Whats the trick to making an invisible misc item.

Post » Sat Jul 24, 2010 2:31 am

Is there a way to make a misc item invisible so that it cannot be seen in the players inventory or looted from other npcs?
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Fri Jul 23, 2010 7:19 pm

I just use an armor item flagged as unplayable.
User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Fri Jul 23, 2010 7:33 pm

I just use an armor item flagged as unplayable.


oh!
ok and this wont have issues with NPCs trying to equip it or anything like that?
User avatar
kennedy
 
Posts: 3299
Joined: Mon Oct 16, 2006 1:53 am

Post » Fri Jul 23, 2010 8:24 pm

Typically I set the item so it has no slots, and you can set the health to 0 also. I think that's enough to make them ignore it.
User avatar
Annika Marziniak
 
Posts: 3416
Joined: Wed Apr 18, 2007 6:22 am

Post » Fri Jul 23, 2010 11:25 pm

Typically I set the item so it has no slots, and you can set the health to 0 also. I think that's enough to make them ignore it.


I seem to be having trouble placing this armor object on NPCs ( Robots and creatures ). It works fine on the player though. Might just be a bug in my script.
User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm

Post » Fri Jul 23, 2010 9:50 pm

By on them you mean in their inventory right? Additem should be all you need. Are you calling pre-existing references, or getting them by refwalking?
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Fri Jul 23, 2010 5:15 pm

By on them you mean in their inventory right? Additem should be all you need. Are you calling pre-existing references, or getting them by refwalking?


ref walking
what is strange is that with the same code I can add a misc item to there inventory but if I change the item to the armor one it just doesn't give it to them..
User avatar
Neil
 
Posts: 3357
Joined: Sat Jul 14, 2007 5:08 am

Post » Fri Jul 23, 2010 7:31 pm

How do you know it isn't giving them the item? Try putting messages in your script for debugging like one after the additem function like "Item Added" then do a check if MyRef.getitemcount... "Ref has item". Posting the scripts at this point might be best so someone can see if there is something wrong in them.
User avatar
michael danso
 
Posts: 3492
Joined: Wed Jun 13, 2007 9:21 am

Post » Sat Jul 24, 2010 6:13 am

How do you know it isn't giving them the item? Try putting messages in your script for debugging like one after the additem function like "Item Added" then do a check if MyRef.getitemcount... "Ref has item". Posting the scripts at this point might be best so someone can see if there is something wrong in them.


it was an error on my part I think.
it seems to work fine now.

Thanks for the help, being able to store variables on the player and NPCs can be super powerful and using armor tokens appears to be a really good way to do it.
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Sat Jul 24, 2010 1:54 am

There's a slight downside- call AddItem on them during combat, and NPCs AI tends to screw up (Creatures don't suffer this problem). If you're adding variables you plan on modifying during fights, use factions and AddToFaction/GetFactionRank instead.
User avatar
Etta Hargrave
 
Posts: 3452
Joined: Fri Sep 01, 2006 1:27 am

Post » Sat Jul 24, 2010 12:49 am

The reason why I thought that the items were not transferring to creatures is because for some odd reason, base abilities for the creature class that should be shared among all of its children don't seem to reliably get added every time. So sometimes I run into super mutants that have no DT at all and others that do. Ghouls and scorpions ect. Its really random but if the creatures have zero DT then they don't get the items and it kind of breaks my script. * Shrugs *
User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am


Return to Fallout: New Vegas