davidnowlin Posted September 26, 2010 Share Posted September 26, 2010 I am trying to create an item sorter that will sort just about every item in the game into multiple containers. The problem I'm having is with items that have a condition like clothing and weapons. I can make the script search my inventory, find out if I have a thing, remove it from my inventory and add it to a container, but it adds it at 100%, unless I specify some other condition with the additemhealthpercent command. I want to have the code check the condition of the item I'm carrying and add it to the container at the same condition. Seems like it should be easy to do. I imagine I'd just use 'additemhealthpercent <quantity> <some variable>' after assigning to that variable a certain percentage that is derived from a check on the item's condition, but I can't find a command that will check the item and get its condition so I can assign it to the variable. Anyone know how to do this? Link to comment Share on other sites More sharing options...
delta401 Posted September 26, 2010 Share Posted September 26, 2010 You have two way:Using cheats (Simple :cool:) Or have the repair ability to 100 Link to comment Share on other sites More sharing options...
davidnowlin Posted September 26, 2010 Author Share Posted September 26, 2010 You have two way:Using cheats (Simple :cool:) Or have the repair ability to 100 Okay... That's not really what I was asking. I know how to take a weapon with a health percent of less than 100 and set it to 100. I want to find a way to make a script remove a weapon from my inventory with a condition of less than 100 (say 65%) and add it to a container at that same condition. I found this a moment ago when googling this problem: Begin GameMode Set LRModeHealth to player.GetWeaponHealthPerc / 100 End Begin OnUnEquip player.additemhealthpercent, 000LaserRifleMode 1 LRModeHealth player.removeitem, 000LaserRifleModeSniper 1 1 End This seems to indicate that the command I'm looking for is "getweaponhealthperc" but the syntax used here is for an equipped weapon. Is there a way to do this for a weapon that is in your inventory but not equipped? Link to comment Share on other sites More sharing options...
ultskeletor Posted September 26, 2010 Share Posted September 26, 2010 There is the FOSE function GetHealth, but I'm not sure whether it returns the current health or the maximum possible health for the object. Link to comment Share on other sites More sharing options...
rickerhk Posted September 26, 2010 Share Posted September 26, 2010 There is currently no function, FOSE or otherwise, to get the health of an item that is in a container. If the items are equipped on the player or an NPC, that's a different story. The 'Removeallitems' function moves items from one container to another without affecting the health, but that doesn't tell what the health is. There may be some creative work-arounds for this that sorting mod-makers have done, but I have only delved into the issue to the extent of making a work-around for my own mod (not a sorter). The FOSE GetHealth function returns the base health of the item that is programmed in the Geck. It's not a percentage. It's the amount of 'hitpoints' the item has at full health. Link to comment Share on other sites More sharing options...
davidnowlin Posted September 26, 2010 Author Share Posted September 26, 2010 There is currently no function, FOSE or otherwise, to get the health of an item that is in a container. If the items are equipped on the player or an NPC, that's a different story. The 'Removeallitems' function moves items from one container to another without affecting the health, but that doesn't tell what the health is. There may be some creative work-arounds for this that sorting mod-makers have done, but I have only delved into the issue to the extent of making a work-around for my own mod (not a sorter). The FOSE GetHealth function returns the base health of the item that is programmed in the Geck. It's not a percentage. It's the amount of 'hitpoints' the item has at full health. Yeah, that's the conclusion I came to, which really irritates me. You know it has to be possible to do it, because, of course, you'd need to know the health of a non-equipped item either to repair it or just to drop it into a container (both of which are things you can do in the game). So it's just that someone decided it wasn't something they should include in the toolset that went out with the Geck and FOSE. :( Sadface. Looks like I'm stucking sorting weapons and apparel by hand. But at least I can do a script for everything else. That's enough for today. Link to comment Share on other sites More sharing options...
Recommended Posts