Jump to content

newitems.txt and ReplaceOnUse


Nelolis

Recommended Posts

I have been trying to edit items from newitems.txt but the only way am able to do so is to change the orginal file also puting eveything from newitems.txt into items.txt works as well. I was able to do it with Vanilla By Kinyoshi as well. I am unable to figure out why I can not change the items normaly. Has anyone else had this problem or know what causes it?

 

item DogfoodOpen
 {
  HungerChange = -30,
  Weight = 1,
  Type = Food,
  DaysTotallyRotten = 7,
  UnhappyChange = 50,
  DisplayName = Open Dogfood,
  Icon = DogfoodOpen,
  DaysFresh = 5,
  ReplaceOnUse  = TinCanl3,
 }

 That is all I was trying to change I tryed it with icecream as well and nothing there eather.

Link to comment
Share on other sites

ReplaceOnDeplete

Tryed it did not work but thanks.

 

 item TunaTinOpen

 {

  HungerChange  = -20,

  Weight   = 0.3,

  Type   = Food,

  DaysTotallyRotten = 4,

  DisplayName  = Open Tin of Tuna,

  Icon   = TunaOpen,

  ReplaceOnUse  = TinCanS,

  DaysFresh  = 2,

 }

This works just fine

Link to comment
Share on other sites

RoboMat both items I have listed are fromt he vanilla game but one is from items.txt and one is from newitems.txt. When I use a tuna can it gives me back the item I want it too but when I use a dogfood can it does not give me back the item it should. I also tryed it with an icecream and it did not give back the time I should eather. Items that i have changed in another module such as the pop can from items.txt work but not anything from newitems.txt

 

 

Also i just renamed newitems.txt and the items worked i changed te files name back and it no longer worked.

Edited by Nelolis
Link to comment
Share on other sites

Everything works just fine but the DogfoodOpen. I am only useing the Base game files and items. first item in the code TunaTinOpen when i eat the can of tuna i get a TinCanS back. But for Dogfood I should get a TinCanl3 but i get nothing. My problem is that any vanilla items i try and get this to change from newitems.txt wont change but items from items.txt do like the tuna can. I watned to add this to my P-38 Can Opener mod but sence i cant get the DogfoodOpen to work I dont see the point.

 

Ways I have got this to work.

1. Change the base newitems.txt

2. Remove newitems.txt and put those items from it in items.txt

3. Use Vanilla By Kinyoshi

4. Change newitems.txt name (I used itemsb.txt worked fine then. Changed the name back it stoped working.)

 

Code:

module Base{ item TunaTinOpen {  HungerChange  = -20,  Weight   = 0.3,  Type   = Food,  DaysTotallyRotten = 4,  DisplayName  = Open Tin of Tuna,  Icon   = TunaOpen,  ReplaceOnUse  = TinCanS,  DaysFresh  = 2, } item TinCanS {  Weight   = 0.1,  CanStoreWater  = TRUE,  Type   = Normal,  DisplayName  = Small empty can,  ReplaceOnUseOn  = WaterSource-TinCanWaterS,  Icon   = TunaOpen, } item TinCanWaterS {  IsWaterSource  = TRUE,  Weight   = 0.3,  CanStoreWater  = TRUE,  Type   = Drainable,  UseWhileEquipped = FALSE,  UseDelta  = 1,  DisplayName  = Small can of water ,  ReplaceOnDeplete = TinCanS,  ReplaceOnUseOn  = WaterSource-TinCanWaterS,  Icon   = TunaOpen, } item TinnedSoup {  HungerChange  = -30,  Weight   = 0.8,  RequireInHandOrInventory= TinOpener,  Type   = Food,  DisplayName  = Canned Soup,  Icon   = TinCan,  ReplaceOnUse  = TinCanl, } item TinCanl {  Weight   = 0.1,  CanStoreWater  = TRUE,  Type   = Normal,  DisplayName  = Empty large can,  ReplaceOnUseOn  = WaterSource-TinCanWaterl,  Icon   = TinCan, } item TinCanWaterl {  IsWaterSource  = TRUE,  Weight   = 0.5,  CanStoreWater  = TRUE,  Type   = Drainable,  UseWhileEquipped = FALSE,  UseDelta  = .3,  DisplayName  = Large can of water ,  ReplaceOnDeplete = TinCanl,  ReplaceOnUseOn  = WaterSource-TinCanWaterl,  Icon   = TinCan, } item OpenBeans {  HungerChange  = -30,  Weight   = 0.8,  Type   = Food,  DaysTotallyRotten = 4,  UnhappyChange  = 10,  DisplayName  = Open Can of Beans,  Icon   = BeansOpen,  DaysFresh  = 2,  ReplaceOnUse  = TinCanl2, } item TinCanl2 {  Weight   = 0.1,  CanStoreWater  = TRUE,  Type   = Normal,  DisplayName  = Empty large can,  ReplaceOnUseOn  = WaterSource-TinCanWaterl2,  Icon   = BeansOpen, } item TinCanWaterl2 {  IsWaterSource  = TRUE,  Weight   = 0.5,  CanStoreWater  = TRUE,  Type   = Drainable,  UseWhileEquipped = FALSE,  UseDelta  = .3,  DisplayName  = Large can of water ,  ReplaceOnDeplete = TinCanl2,  ReplaceOnUseOn  = WaterSource-TinCanWaterl2,  Icon   = BeansOpen, } item DogfoodOpen {  HungerChange = -30,  Weight = 1,  Type = Food,  DaysTotallyRotten = 7,  UnhappyChange = 50,  DisplayName = Open Dogfood,  Icon = DogfoodOpen,  ReplaceOnUse  = TinCanl3,  DaysFresh = 5, } item TinCanl3 {  Weight   = 0.1,  CanStoreWater  = TRUE,  Type   = Normal,  DisplayName  = Empty large can,  ReplaceOnUseOn  = WaterSource-TinCanWaterl3,  Icon   = DogfoodOpen, } item TinCanWaterl3 {  IsWaterSource  = TRUE,  Weight   = 0.5,  CanStoreWater  = TRUE,  Type   = Drainable,  UseWhileEquipped = FALSE,  UseDelta  = .3,  DisplayName  = Large can of water ,  ReplaceOnDeplete = TinCanl3,  ReplaceOnUseOn  = WaterSource-TinCanWaterl3,  Icon   = DogfoodOpen, } item BadFood {  HungerChange  = -10,  UnhappyChange  = 100,  Weight   = .5,  Type   = Food,  DisplayName  = Ruined Food,  Icon   = DogfoodOpen,  DaysFresh  = ,1,  DaysTotallyRotten = 0,  IsCookable  = FALSE,  DangerousUncooked = TRUE, }}
Link to comment
Share on other sites

Well to echo RoboMat's question - how have you tried setting your module and base?  Are you doing something like:

module SICmod {			imports	    {	        Base,			camping	    }

instead of:

module Base {

The former may work for you, it worked for my Skinned Rat recipe (DeadRat being in newitems.txt)

Link to comment
Share on other sites

Well to echo RoboMat's question - how have you tried setting your module and base?  Are you doing something like:

module SICmod {			imports	    {	        Base,			camping	    }

instead of:

module Base {

The former may work for you, it worked for my Skinned Rat recipe (DeadRat being in newitems.txt)

 

Yeah I had already tryed that. did not work. Thanks

Link to comment
Share on other sites

You might ping The_Real_Al, it's possible his problem was similar:

 

http://theindiestone.com/forums/index.php/topic/1160-double-entries-in-scriptstxt-necessary/

It seems a fresh install fixed his problem. I have done that a few times and it doesnt help. The only sure way to fix it is to change newitems.txt file name. Maybe i should just say that Vanilla By Kinyoshi is needed for it to work.

Link to comment
Share on other sites

Yeah that about sums it up. But i have "Fixed" it.

 

Works:

module Base{ imports { Base }

 

Will not work any of the module:

module tincans{ imports { Base }

 

I have done it to a few vanilla items and I had no problems up untell this point. Guess I will mark it solved.

Thanks everyone for the help on trying to solve it. :D

Link to comment
Share on other sites

Nope tryed that. Every time i tryed to name a mod something other then Base it never works. I just reinstalled PZ and now i cant get any new mods i make to work even something thats just one recipe like this.

 

moduel Base{ recipe Stuff {  RippedSheets,       Result:BaseballBatNails,    Time:150.0, }}

Link to comment
Share on other sites

 

Nope tryed that. Every time i tryed to name a mod something other then Base it never works. I just reinstalled PZ and now i cant get any new mods i make to work even something thats just one recipe like this.

 

moduel Base{ recipe Stuff {  RippedSheets,       Result:BaseballBatNails,    Time:150.0, }}

 

That's because your wrote moduel instead of module ...

Link to comment
Share on other sites

Ok I have now figured out how it works. And got it to work. Figured it out by changing the names between a and z.

 

 

1. I had changed the name of my orginal file from TinCans to emptycans

2. This put it under the newitems.txt file so when it loaded the files it loaded newitems.txt first then TinCans.txt so the item from TinCans.txt was the active item.

3. Sub folders under media/scripts changes the load order.

 

 

Again thanks everyone for all the help. Now I can eat my Dogfood (or dump out rotten food for the can) and get my can too!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...