Fienyx Posted January 22, 2015 Share Posted January 22, 2015 I'm having an issue between 2 mods that doesn't make any sense to me.  Finite ammo and Equipment Converter.  Finite ammo seems to be the cause of the issue, but the realism of having only 20 arrows in your quiver, and not being able to refill during combat is what I like about it.  Equipment Converter lets you keep that nice looking, weaker equipment and give it the stats of something better, or vice versa. Meaning leather armor with daedric stats, or a silver longsword with the stats of a rusty iron dagger. (of course, that's to be given to someone else, lol)  With both mods active, If you try,  You put the item in the model pot, next item in the stats pot, hit the converter, get a message, "Finite Ammo Token Ring Added", and lose both pieces of equipment.  It's not a LO issue either, I have tried one above the other, One above the patch one below, no matter where either is in the load order, it always gives the same result. I spent 3 hours messing around with load orders.  If I remove finite ammo, the equipment converter works perfectly.  Edit:These two don't show any conflicts in obmm conflict detector either. I checked the scripts in cs and checked them in tes4edit, I can't find anything that references the other in any way. Link to comment
movomo Posted January 22, 2015 Share Posted January 22, 2015 This isn't as simple as it may seem. Probably has something to do with how exactly these mod work. Â I never tried any of them, but from your description, it seems like Equipment Converter clones the item in the "model pot". Actually clones the item in the stats pot and replace its model path with the one in the model pot. This is how I'll get it working if I have to write the same kind of mod. As to Finite Ammo mod, no idea unless I actually take a look. Probably this one is responsible for removing the cloned arrows. But the point is, you'll have to modify the scripts... or not. Link to comment
Fienyx Posted January 22, 2015 Author Share Posted January 22, 2015 Yes, Equipment Converter (EC) does clone.  ===== From mod description =====  Finally a minor bloat warning.The system uses cloneform to make the new objects, as well as any enchantment that needs cloning (if it's not from Oblivion.esm, enchantment station, or a previously merged item). This ensures that the base-object of your new item is saved in your savegame, and keeps its stats, model and enchantment. This happens once every time you use the pot and should not cause serious trouble unless you go mad with it and clone items hundreds of times using cheat mode.  As for Finite Ammo (FA), I'm not sure what I would need to change. I have no problems with changing a script though. Here's the main script for FA   scn FAControlScript  short ammoChk short ammoCnt short attackKey short attackButton short bundleCnt short isAttackPressed short isXblt short maxAmmo short spellTimer ref ammoEnch ref ammoRef ref curAmmo ref curCont ref menuRef float ammoDamage float ammoWeight float fQuestDelayTime  BEGIN MenuMode  set attackKey to getControl 4 set attackButton to getAltControl2 4 set isAttackPressed to ( isKeyPressed3 attackKey + isKeyPressed3 attackButton ) set menuRef to getActiveMenuSelection if ( MenuMode 1008 ) setQuestItem 1 faAmmoBundle set curCont to getActiveMenuRef if ( curCont.getItemCount FATokenRing == 0 ) curCont.addItem FATokenRing 1 endif return elseif ( menumode 1 ) setQuestItem 0 faAmmoBundle if ( menuRef == faAmmoBundle ) disablePlayerControls if ( isAttackPressed ) player.equipItemNS faAmmoBundle endif else enablePlayerControls endif set curAmmo to player.getEquippedObject 17 set isXblt to modelPathIncludes "xbowBolt" curAmmo if ( isXblt ) set maxAmmo to 10 else set maxAmmo to 20 endif if ( curAmmo ) if ( player.isInCombat ) if ( curAmmo != ammoRef ) message "You can not swap ammo while in combat." player.unequipItemNS curAmmo set ammoCnt to ( player.getItemCount ammoRef - 1 ) player.removeItemNS ammoRef ammoCnt player.equipItemNS ammoRef player.addItemNS ammoRef ammoCnt return endif elseif ( curAmmo == faAmmoBundle ) player.addItemNS ammoRef bundleCnt player.removeItemNS faAmmoBundle bundleCnt set ammoRef to 0 elseif ( curAmmo != ammoRef ) if ( player.getItemCount faAmmoBundle != 0 ) player.addItemNS ammoRef bundleCnt player.removeItemNS faAmmoBundle bundleCnt else set ammoRef to curAmmo endif elseif ( player.getItemCount curAmmo > maxAmmo ) if ( player.getItemCount faAmmoBundle != 0 ) player.addItemNS ammoRef bundleCnt player.removeItemNS faAmmoBundle bundleCnt set ammoRef to 0 endif set bundleCnt to ( player.getItemCount curAmmo - maxAmmo ) set ammoRef to curAmmo copyName curAmmo faAmmoBundle appendToName " Bundle" faAmmoBundle copyModelPath curAmmo faAmmoBundle copyIconPath curAmmo faAmmoBundle set ammoEnch to getEnchantment curAmmo removeEnchantment faAmmoBundle setEnchantment ammoEnch faAmmoBundle set ammoWeight to getWeight curAmmo setWeight ammoWeight faAmmoBundle set ammoDamage to getAttackDamage curAmmo setAttackDamage ammoDamage faAmmoBundle player.addItemNS faAmmoBundle bundleCnt player.removeItemNS curAmmo bundleCnt set ammoCnt to ( player.getItemCount ammoRef - 1 ) player.removeItemNS ammoRef ammoCnt player.equipItemNS ammoRef player.addItemNS ammoRef ammoCnt endif endif endif  END  Begin GameMode  set fQuestDelayTime to 0.1 set spellTimer to ( spellTimer + 1 ) if ( spellTimer >= 10 ) if ( XbowSpellBallRef.getInSameCell Player == 0 ) XbowSpellBallRef.moveTo Player 0 0 150 elseif ( XbowSpellBallRef.getDistance Player > 1000 ) XbowSpellBallRef.moveTo Player 0 0 150 endif XbowSpellBallRef.cast FAAmmoSpell Player endif set curAmmo to player.getEquippedObject 17 set isXblt to modelPathIncludes "xbowBolt" curAmmo if ( isXblt ) set maxAmmo to 10 else set maxAmmo to 20 endif if ( curAmmo ) if ( player.isInCombat ) if ( curAmmo != ammoRef ) message "You can not swap ammo while in combat." player.unequipItemNS curAmmo set ammoCnt to ( player.getItemCount ammoRef - 1 ) player.removeItemNS ammoRef ammoCnt player.equipItemNS ammoRef player.addItemNS ammoRef ammoCnt return endif elseif ( curAmmo != ammoRef ) if ( player.getItemCount faAmmoBundle != 0 ) player.addItemNS ammoRef bundleCnt player.removeItemNS faAmmoBundle bundleCnt else set ammoRef to curAmmo endif set ammoChk to 0 elseif ( player.getItemCount curAmmo > maxAmmo && ammoChk == 0 ) set bundleCnt to ( player.getItemCount curAmmo - maxAmmo ) set ammoRef to curAmmo copyName curAmmo faAmmoBundle appendToName " Bundle" faAmmoBundle copyModelPath curAmmo faAmmoBundle copyIconPath curAmmo faAmmoBundle set ammoEnch to getEnchantment curAmmo removeEnchantment faAmmoBundle setEnchantment ammoEnch faAmmoBundle set ammoWeight to getWeight curAmmo setWeight ammoWeight faAmmoBundle set ammoDamage to getAttackDamage curAmmo setAttackDamage ammoDamage faAmmoBundle player.addItemNS faAmmoBundle bundleCnt player.removeItemNS curAmmo bundleCnt set ammoCnt to ( player.getItemCount ammoRef - 1 ) player.removeItemNS ammoRef ammoCnt player.equipItemNS ammoRef player.addItemNS ammoRef ammoCnt set ammoChk to 1 endif endif  End  Link to comment
Fienyx Posted January 22, 2015 Author Share Posted January 22, 2015 Here's the ammo script for FA   scn FAAmmoScript  ref temp ref curAmmo ref curTarget short isXblt short count short maxAmmo  Begin GameMode  set temp to getSelf  if ( getSelf != player && getSelf != playerRef && getIsCreature == 0 ) set curAmmo to temp.getEquippedObject 17 set isXblt to modelPathIncludes "xbowBolt" curAmmo if ( curAmmo == 0 ) return elseif ( temp.getItemCount FATokenRing != 0 ) return else if ( isXblt == 1 ) set maxAmmo to 10 else set maxAmmo to 20 endif if ( temp.getItemCount FACheckRing == 0 ) set count to temp.getItemCount curAmmo if ( count < maxAmmo ) set count to ( maxAmmo - count ) temp.addItem curAmmo count endif temp.addItem FACheckRing 1 elseif ( temp.getDead ) temp.addItem FATokenRing 1 set maxAmmo to temp.getItemCount faCountRing temp.removeItem FACountRing maxAmmo temp.removeItem curAmmo maxAmmo temp.setRestrained 0 elseif ( temp.isInCombat ) set curTarget to temp.getCombatTarget if ( temp.getItemCount FACountRing >= maxAmmo ) temp.stopCombat curTarget if ( isWeaponOut == 0 ) temp.addItem FATokenRing 1 temp.removeItem FACountRing maxAmmo temp.removeItem curAmmo maxAmmo temp.equipItem curAmmo temp.setRestrained 0 endif elseif ( temp.getWeaponSkillType == 3 ) if ( temp.getRestrained == 0 && temp.isAttacking == 1 ) temp.setRestrained 1 elseif ( temp.getRestrained == 1 && temp.isAttacking == 0 ) temp.setRestrained 0 temp.addItem FACountRing 1 endif endif endif endif endif  End     Bundle Script    scn FABundleScript  BEGIN OnEquip player  set FAControl.removeChk to 1  END Link to comment
Fienyx Posted January 22, 2015 Author Share Posted January 22, 2015 For comparison, here's the main script for EC.   SCN HTBEquipmentConvertScript  Ref StatsSource Ref ModelSource Ref NewItem Ref AEnch Ref NewEnch Short Ac Short Cc Short Aslot Short Cslot Short FLG Short WpA Short WpB Short CheatA Short CheatC  Begin OnActivate  set FLG to 0 set Ac to HTBECStatsSourceRef.GetNumItems set Cc to HTBECModelSourceRef.GetNumItems  If Ac == 0 || Cc == 0 set FLG to 1 ;No Items Return endif  Set StatsSource to HTBECStatsSourceRef.GetInventoryObject 0 Set ModelSource to HTBECModelSourceRef.GetInventoryObject 0 ;--------------------------------------------------------- ; A Weapon ;--------------------------------------------------------- If StatsSource.IsWeapon StatsSource == 1 if ModelSource.IsWeapon ModelSource == 1 set WpA to StatsSource.GetWeaponType StatsSource set WpB to ModelSource.GetWeaponType ModelSource  If (WpA == 0 && WpB != 0 && WpB != 2) set FLG to 3 ;Different Types Return endif If (WpA == 2 && WpB != 0 && WpB != 2) set FLG to 3 ;Different Types Return endif If (WpA == 1 && WpB != 1 && WpB != 3) set FLG to 3 ;Different Types Return endif If (WpA == 3 && WpB != 1 && WpB != 3) set FLG to 3 ;Different Types Return endif If (WpA == 4 || WpA == 5 || WpA == 6) If WpA != WpB set FLG to 3 ;Different Types Return endif endif set NewItem to CloneForm StatsSource CopyName ModelSource NewItem CopyModelPath ModelSource NewItem  If (ModelSource.isIconPathValid ModelSource) CopyIconPath ModelSource NewItem endif  set AEnch to 0 set AEnch to StatsSource.GetEnchantment StatsSource  if AEnch != 0 if IsClonedForm AEnch == 0 && AEnch.GetSourceModIndex > 0 ; It's not a cloned form yet and it's from a mod, so clone it set NewEnch to CloneForm AEnch NewItem.SetEnchantment NewEnch NewItem else ; Base game enchantment or already in savegame, so apply it NewItem.SetEnchantment AEnch NewItem endif endif  ;Cheats? If CheatA == 0 HTBECStatsSourceRef.RemoveAllItems endif  if CheatC == 0 HTBECModelSourceRef.RemoveAllItems endif  ;Give the new item Player.AddItem NewItem 1 Return else ; Incompatible items set FLG to 3 ;Different Types Return endif endif  ;--------------------------------------------------------- ; Not a Weapon ;--------------------------------------------------------- set Aslot to GetEquipmentSlot StatsSource set Cslot to GetEquipmentSlot ModelSource  If Aslot != Cslot If (Aslot != 6 && Aslot != 7 && Aslot != 8 && Aslot != 15) set FLG to 3 ;Different Types Return endif if (Cslot != 6 && Cslot != 7 && Cslot != 8 && Cslot != 15) set FLG to 3 ;Different Types Return endif endif  set NewItem to CloneForm StatsSource  If MaleBipedPathIncludes "." ModelSource CopyMaleBipedPath ModelSource NewItem endif If MaleGroundPathIncludes "." ModelSource CopyMaleGroundPath ModelSource NewItem endif If MaleIconPathIncludes "." ModelSource CopyMaleIconPath ModelSource NewItem endif  CopyName ModelSource NewItem  If FemaleBipedPathIncludes "." ModelSource CopyFemaleBipedPath ModelSource NewItem endif If FemaleGroundPathIncludes "." ModelSource CopyFemaleGroundPath ModelSource NewItem endif If FemaleIconPathIncludes "." ModelSource CopyFemaleIconPath ModelSource NewItem endif  set AEnch to 0 set AEnch to StatsSource.GetEnchantment StatsSource  if AEnch != 0 if IsClonedForm AEnch == 0 && AEnch.GetSourceModIndex > 0 ; It's not a cloned form yet and it's from a mod, so clone it set NewEnch to CloneForm AEnch NewItem.SetEnchantment NewEnch NewItem else ; Base game enchantment or already in savegame, so apply it NewItem.SetEnchantment AEnch NewItem endif endif  If CheatA == 0 HTBECStatsSourceRef.RemoveAllItems endif  if CheatC == 0 HTBECModelSourceRef.RemoveAllItems endif  Player.AddItem NewItem 1  end     Like I said, I looked through the scripts, and have no idea why the sword or armor I try to make with EC prints a message "Finite Ammo Token Ring Added" I remove FA and EC works perfectly.    Maybe I missed something in there.  Edit: Here's the other scripts for EC  Convert quest script   SCN HTBAddConvertorQuestScript  short doonce  begin gamemode  if doonce == 0 player.additem HTBECConversionTrigger 1 player.additem HTBECModelUrn 1 player.additem HTBECStatsUrn 1 set doonce to 1 else stopquest HTBECAddConvertorQuest endif end    Stat Urn    SCN HTBECStatsUrnScript  short menu short button  Begin OnActivate Player If Player.IsSneaking == 1 set menu to 1 else HTBECStatsSourceRef.Activate Player endif end  begin gamemode  if menu == 0 return endif  if menu == 1 set menu to -1 set button to -1 if HTBECConverterRef.cheatA==0 messagebox "Source of stats - Options" "Open" "Toggle cheat mode on" "Pick up"  "Cancel" else messagebox "Source of stats - Options" "Open" "Toggle cheat mode off" "Pick up"  "Cancel" endif elseif menu == -1 set button to getButtonPressed if button < 0 Return elseif button == 0 ; Open set menu to 0 HTBECStatsSourceRef.Activate Player return elseif button == 1 ; Cheat mode set menu to 0 set HTBECConverterRef.cheatA to (HTBECConverterRef.cheatA==0) return elseif button == 2 ; Pick Up set menu to 0 HTBECStatsSourceRef.RemoveAllItems Player Activate else set menu to 0 endif endif  end    Model Urn     SCN HTBECModelUrnScript  short menu short button   Begin OnActivate Player If Player.IsSneaking == 1 set menu to 1 else HTBECModelSourceRef.Activate Player endif end  begin gamemode  if menu == 0 return endif  if menu == 1 set menu to -1 set button to -1 if HTBECConverterRef.cheatC==0 messagebox "Source of shape - Options" "Open" "Toggle cheat mode on" "Pick up"  "Cancel" else messagebox "Source of shape - Options" "Open" "Toggle cheat mode off" "Pick up"  "Cancel" endif elseif menu == -1 set button to getButtonPressed if button < 0 Return elseif button == 0 ; Open set menu to 0 HTBECModelSourceRef.Activate Player return elseif button == 1 ; Cheat mode set menu to 0 set HTBECConverterRef.cheatC to (HTBECConverterRef.cheatC==0) return elseif button == 2 ; Pick Up set menu to 0 HTBECModelSourceRef.RemoveAllItems Player Activate else set menu to 0 endif endif  end Link to comment
movomo Posted January 22, 2015 Share Posted January 22, 2015 Unfortunately, no one can figure out what's going on there with only fragments of scripts. I've noticed a couple of weird things, but they don't seem to be enough to make much difference alone. If you can make sense of them, I'd try spamming debug messages. That is the starting point of any debugging. Link to comment
Fienyx Posted January 22, 2015 Author Share Posted January 22, 2015 I edited the posts. Those are all the scripts, complete. They don't copy and paste nicely indented how they show in the cs. I used tdt in the console, but nothing comes up for either mod. I un / equipped bow, arrows and used the converter, but nothing in the text changed. I've never debugged anything before, and this is honestly the first time I've come across an issue like this. Will keep trying to figure this out. What were the couple of weird things you noticed? Link to comment
movomo Posted January 23, 2015 Share Posted January 23, 2015 No, tdt has nothing to do with this. What I meant was that you have to write debug messages (like printc) between them and see what's happening with your eyes. Â As to what I had noticed: for example, FAAmmoScript has this. if ( getSelf != player && getSelf != playerRef && getIsCreature == 0 ) This script is *probably* supposed to work only on NPCs. But this may also run on containers. Suspicious, but I couldn't be certain. Link to comment
Fienyx Posted January 23, 2015 Author Share Posted January 23, 2015 Yeah, I don't know how that all works and have lost all ambition on it. I chose to keep the converter. Decided keeping neat looking things is more important than having every npc and myself limited to 20 arrows per battle. Thanks for trying to help. I just wish I could get into it more. MS is a bitch. Link to comment
movomo Posted January 23, 2015 Share Posted January 23, 2015 Nah, actually, try this. I've found it. Â First, open the script named "HTBEquipmentConvertScript" Â Next, declare two more array variables. array_var arItems array_var arIter1 Find these lines (line 29, 30) Set StatsSource to HTBECStatsSourceRef.GetInventoryObject 0 Set ModelSource to HTBECModelSourceRef.GetInventoryObject 0 Correct them like this ; Set StatsSource to HTBECStatsSourceRef.GetInventoryObject 0 ; Set ModelSource to HTBECModelSourceRef.GetInventoryObject 0 Let arItems := HTBECStatsSourceRef.GetItems ForEach arIter1 <- arItems Let StatsSource := arIter1["value"] if IsPlayable2 StatsSource break endif loop Let arItems := HTBECModelSourceRef.GetItems ForEach arIter1 <- arItems Let ModelSource := arIter1["value"] if IsPlayable2 ModelSource break endif loop Let arItems := arIter1 := ar_Null You should be find with this. uh, probably. Link to comment
Fienyx Posted January 23, 2015 Author Share Posted January 23, 2015 Movomo, you are the best.  They both work how they should now, thank you. I try to learn this, but the reading limitations and the...... oh, a squirrel!  What was I saying? Oh yeah, I have concentration issues. LOL  When your wiring starts to fry, it does all sorts of things. Thanks to MS, and somewhere between 35-40 minor concussions in 3 1/2 yrs, I'm a much different person. Kinda  adhd, bi-polar and something else, I forget what it was.    But, I digress, YOU ARE PURE AWESOME!!!  Hell, it took me 3 days to get the PSE-SeeYouSleepDLL patch I made. And that's a nice short script. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.