senterpat Posted July 11, 2013 Share Posted July 11, 2013 So I have need of some assistance. I don't know what function I can use for this. Problem: I have several items I am using getitemcount to check and see if they have any, problem is the list of items is way too long now, and exceeds the 512 limit. So if anyone has any ideas of how to do this, I'd greatly appreaciate it. I don't want to change the names to be shorter unless i have to, as they are used in multiple scripts.The script is: scn CigaretteAidToApparel ;based off of 'light up and smokes those cigarettes' script. Begin ScriptEffectStart if Player.GetItemCount GoAWearableCigarette001 == 0 && Player.GetItemCount GoAWearableCigarello001 == 0 && Player.GetItemCount GoAWearableCigar001 == 0 && Player.GetItemCount GoAWearableCigarette001BlackDeath == 0 && Player.GetItemCount GoAWearableCigarette001Camel == 0 && Player.GetItemCount GoAWearableCigarette001CamelAlt == 0 && Player.GetItemCount GoAWearableCigarette001JinLing == 0 && Player.GetItemCount GoAWearableCigarette001LuckystrikeAlt == 0 ;I need to add another 6 or so items on the list. Player.AddItem GoAWearableCigarette001 1 1 Player.EquipItem GoAWearableCigarette001 1 1 PlaySound CigaretteLighter 1 player.AddItem AidCigarette 1 1 ; To force refresh of the Inventory player.RemoveItem AidCigarette 1 1 ; To force refresh of the Inventory elseif Player.GetItemCount GoAWearableCigarette001 >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001BlackDeath >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001Camel >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001CamelAlt >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001JinLing >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001LuckyStrikeAlt >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001LuckyStrikeOriginal >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001LuckyStrikeGreen >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001LuckyStrikeRetro >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001Marlboro >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001MarlboroMenthol >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001OldGold >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarette001PlayerNavyCut >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigar001 >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 elseif Player.GetItemCount GoAWearableCigarello001 >= 1 ShowMessage AlreadySmokingMsg Player.AddItem AidCigarette 1 1 endIf End Link to comment Share on other sites More sharing options...
blove Posted July 11, 2013 Share Posted July 11, 2013 Try adding those items to a formlist then doing your getitemcount on the formlist to shorten that line. Link to comment Share on other sites More sharing options...
senterpat Posted July 11, 2013 Author Share Posted July 11, 2013 I love you. But seriously, worked like a charm. Thanks so much man, kudos to you. Link to comment Share on other sites More sharing options...
Recommended Posts