Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat
Welcome, Guest. Please login or register.
Did you miss your activation email?

December 08, 2021, 10:02:10 PM

Login with username, password and session length

Author Topic: Script - Batch change lot settings  (Read 6115 times)

0 Members and 1 Guest are viewing this topic.

Offline dyas

  • Forums Inhabitant
  • *
  • Posts: 11
  • Total likes: 0
  • Reputation: 0
  • So long and thanks for all the fish
Script - Batch change lot settings
« on: May 02, 2013, 09:00:47 PM »
Hi, I wanted to make a realistic city, but worry less about my props costing me money. Is it possible to batch remove good and bad effects from a group of lots as well as make them cost 0? I want to be able to use them without worry of money, but I don't want to be getting good or bad effects. Basically I just want them to look shiny. I did one manually, but this would be a large work to convert them all? Thanks if some scripter can help me out.

Offline whatevermind

Re: Script - Batch change lot settings
« Reply #1 on: May 02, 2013, 10:13:39 PM »
You might find this thread helpful.

Offline dyas

  • Forums Inhabitant
  • *
  • Posts: 11
  • Total likes: 0
  • Reputation: 0
  • So long and thanks for all the fish
Re: Script - Batch change lot settings
« Reply #2 on: May 03, 2013, 08:53:00 AM »
Thanks, what if they are a bunch of lots, and not a dat though? I'm still looking at it though as this seems the right direction.

Edit:
So. I used http://sc4devotion.com/csxlex/lex_filedesc.php?lotGET=26 to put all the plugins in question into a compressed .dat file. Than I used the find and replace as suggested. I say this in case anyone else asks this question.

Edit2:
Well I combined them all. Batched changed the info, and than SC4 kept crashing. I deleted my .dat and it worked fine.
« Last Edit: May 03, 2013, 10:02:27 AM by dyas »

Offline whatevermind

Re: Script - Batch change lot settings
« Reply #3 on: May 03, 2013, 07:30:45 PM »
I think datpacking the lots makes sense, should make it easier to work with. That said, I've never actually tried using the procedures in that other thread, so I can't say much for how well they work or what bugs might occur. Unfortunately, there's a lot of reasons SC4 can crash, and there's a lot of ways a big file can get corrupted, so I don't have much advice other than to just keep trying different arrangements and see if you can pinpoint the problem.

Offline dyas

  • Forums Inhabitant
  • *
  • Posts: 11
  • Total likes: 0
  • Reputation: 0
  • So long and thanks for all the fish
Re: Script - Batch change lot settings
« Reply #4 on: May 03, 2013, 07:50:49 PM »
Ok, when you data pack a file, there were 3 files with each lot. Do I put all 3 in? does it change the dependencies listed in each file?

Offline Magneto

  • NAM Team
  • Forums Councilmember
  • *
  • Posts: 68
  • Total likes: 0
  • Reputation: 0
Re: Script - Batch change lot settings
« Reply #5 on: May 03, 2013, 08:53:30 PM »
Yes, when you datpack a file, always keep the related sc4model, sc4lot & desc files together.

Offline dyas

  • Forums Inhabitant
  • *
  • Posts: 11
  • Total likes: 0
  • Reputation: 0
  • So long and thanks for all the fish
Re: Script - Batch change lot settings
« Reply #6 on: May 03, 2013, 10:13:40 PM »
Ok, I got a data pack file going. I tried to batch change all the budget cost to 0 to start with. It changes all the ones it finds, but it seems that some link to a parent cohert that still has a cost? :( I'm making progress, and using the exempler search and mass edit thing, but not working yet.
Here are pictures so maybe that will help:




It won't let me set the second one. And I think that one is the one that is in game. So the cost never changed?
« Last Edit: May 03, 2013, 10:55:47 PM by dyas »

Offline whatevermind

Re: Script - Batch change lot settings
« Reply #7 on: May 04, 2013, 07:45:11 PM »
To edit values inherited from parent cohorts you'll have to find the cohort in question and edit the property there. If any of them are default game cohorts, you'll find those in the sc1 dat, and you can make a copy of them and then edit the copy and add it to your patch.

Offline dyas

  • Forums Inhabitant
  • *
  • Posts: 11
  • Total likes: 0
  • Reputation: 0
  • So long and thanks for all the fish
Re: Script - Batch change lot settings
« Reply #8 on: May 05, 2013, 08:59:54 AM »
Can I just change the cohort? I don't want to per say change a real SC4 file. I bet they are linked to the grass field plot though.

Offline whatevermind

Re: Script - Batch change lot settings
« Reply #9 on: May 05, 2013, 03:28:25 PM »
That should work too. I also think that if the same property is in both the cohort and the exemplar, the value in the exemplar will override the one in the cohort, but I could be wrong. That's something you should be able to test in game.