World of Banished

Conversations => Suggestions and Mod Ideas => Topic started by: Bobbi on September 08, 2014, 03:31:49 PM

Title: No Idling in hospitals, and maybe a small clinic?
Post by: Bobbi on September 08, 2014, 03:31:49 PM
In @RedKetchup's topic Creamery mod thread, on page two he mentioned:

but in DoctorHouse.rsc i found that :

Code: [Select]

HappinessDescription happiness
{
   HappinessType _happinessType = Health;
   bool _requireWorker = true;
   int _idleRange = 5;
}

Does this mean that potentially a mod could be made to eliminate or at least greatly reduce the desire to hand out in hospitals?

And as another thought, similar to my hope for a smaller church, how about a small clinic for small towns in addition to big hospital? Maybe can only care for 5 people instead of 20? Although personally I feel that 20 isn't very many for a building that size. Maybe 20 per physician and have the ability to add up to, say, 5 doctors?
I wish I could mod....
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 08, 2014, 03:59:49 PM
yup exactly, you delete those, + the declare statement at top of the .rsc

// layout of the entity
ComponentDescription resource



      "happiness",


and noone we go idle there anymore
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 09, 2014, 09:32:51 AM
Quote from: RedKetchup on September 08, 2014, 03:59:49 PM
yup exactly, you delete those, + the declare statement at top of the .rsc

// layout of the entity
ComponentDescription resource



      "happiness",


and noone we go idle there anymore

Seriously? That's all it takes? Man, I wish all stupidity were that easy to deal with.

The other issue with the hospital is that the contagion distance for the disease still holds even when the people are in the hospital. If that could be dealt with we could begin building hospitals in more realistic locations. Now, even if no one were idling at (or inside) the hospital they still get sick just from walking by on their way to some job.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 09, 2014, 09:35:33 AM
try it ! and let us know if it works :)
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 10, 2014, 08:09:01 AM
So, the relevant code in DoctorHouse.rsc is:

HappinessDescription happiness
{
   HappinessType _happinessType = Health;
   bool _requireWorker = true;
   int _idleRange = 5;
}

And:

// layout of the entity
ComponentDescription resource

      "happiness",

All you have to do to keep people from idling in the hospital is delete those lines? If that's true even my meager coding skills may be enough.

The question of reducing contagion around hospitals seems much more complicated, though, eh?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Bobbi on September 10, 2014, 09:05:27 AM
@rkelly17, you make it, I will be happy to test. Reducing contagion would be harder to do, I am guessing.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: irrelevant on September 10, 2014, 09:15:46 AM
Well, there's this: http://worldofbanished.com/index.php?topic=357.0

Could maybe tweak the radius?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 10, 2014, 09:22:52 AM
This is somewhat more frustrating than it appears at first and the instructions in the Readme.html that came with the modkit are not all that helpful.  >:( Could @RedKetchup or @slink or someone who has made a mod come to my rescue? I created a folder called Hostop, put the two changed .rsc files in it (I decided to add the "health" happiness factor to the herbalist's cabin when I took it away from the hospital, so Herbalist.rsc and DoctorHouse.rsc) and then tried to run Tools-x64.exe from the command line as follows:

c:\BanishedKit\bin>Tools-x64 /pathres Hostop /mod NoIdle

This is what came back:

SRS Toolset version 1.0.4 Beta Build 140825

An assertion failure has occurred. A crash dump has been saved.

Location: Object\ExternalFactory.cpp(207)
Message: Can't use a local file path without loading something previously!
Expression: !_pathStack.IsEmpty()

Callstack:
Runtime-x64-profile.dll(0x00000000e093a733)
unknown(0x00000000fffffffe)
unknown(0x00000000002ccce0)
unknown(0x0000000000000001)
unknown(0x00000000002cbf40)
unknown(0x00000000002ccd90)

The crash dump was identical to the above.

What have I done wrong?  :-[
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 10, 2014, 09:23:52 AM
Quote from: irrelevant on September 10, 2014, 09:15:46 AM
Well, there's this: http://worldofbanished.com/index.php?topic=357.0

Could maybe tweak the radius?

But that would change it in all conditions, right?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: irrelevant on September 10, 2014, 09:31:04 AM
Well, yes  :D
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 10, 2014, 09:42:19 AM
your .bat should look more like to that :

bin\Tools-x64.exe /build creameryResources.rsc /pathres ../example/creamery /pathdat ../example/creamery/bin
bin\Tools-x64.exe /mod Package.rsc:creamery /pathres ../example/creamery /pathdat ../example/creamery/bin
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 10, 2014, 10:24:39 AM
Quote from: RedKetchup on September 10, 2014, 09:42:19 AM
your .bat should look more like to that :

bin\Tools-x64.exe /build creameryResources.rsc /pathres ../example/creamery /pathdat ../example/creamery/bin
bin\Tools-x64.exe /mod Package.rsc:creamery /pathres ../example/creamery /pathdat ../example/creamery/bin

I'm sorry to be such a pest, @RedKetchup, but could you explain a bit what is going on in each of those lines? As I read them the first line builds a file called creameryResources.rsc in the path indicated, then the second line creates a package called creamery in the paths indicated. Am I getting it? WHat is the difference between /pathres and /pathdat? I'm assuming that the ../ is a reference to the root of  the folder example. Could you also just summarize your folder structure in the mod kit folder?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 10, 2014, 10:59:19 AM
the first line compile everything into binary files : it makes your /bin directory and put all your line into binary files aka .crs (your line codes are in txt .rsc)

the second line take all the binary files and do a package with it ( aka your .pkm package)

so if you put your files are in \example\NoIdle

then your .bat should look :


bin\Tools-x64.exe /build NoIdleResources.rsc /pathres ../example/NoIdle /pathdat ../example/NoIdle/bin
bin\Tools-x64.exe /mod Package.rsc:noidle /pathres ../example/NoIdle /pathdat ../example/NoIdle/bin


and your dir \example\NoIdle should look like:

Package.rsc
NoIdleResources.rsc
icon.png

and have a dir called \Template


in \Template dir you should have your modified files like the doctorhouse.rsc and everything you also added
your NoIdleResources.rsc should call your doctorhouse.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: slink on September 10, 2014, 04:32:08 PM
I use a single batch file named BuildOverride.bat.  It's contents are as follows.

bin\Tools-x64.exe /build Package.rsc:list /pathres ../example/Override /pathdat ../example/Override/bin

bin\Tools-x64.exe /mod Package.rsc:override /pathres ../example/override /pathdat ../example/override/bin


Then, in a directory under Examples I have Package.rsc, for which an example follows.

PackageFile override
{
String _name = "Immortal Orchard Trees Override";
String _author = "SJGL";
String _description = "This mod makes the standard eight orchard trees live forever.";
int _userVersion = 1;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"
]
}

ExternalList list
{
External _resources
[
"Template/NaturalResourceAppleTree.rsc"
"Template/NaturalResourceCherryTree.rsc"
"Template/NaturalResourceChestnutTree.rsc"
"Template/NaturalResourcePeachTree.rsc"
"Template/NaturalResourcePearTree.rsc"
"Template/NaturalResourcePecanTree.rsc"
"Template/NaturalResourcePlumTree.rsc"
"Template/NaturalResourceWalnutTree.rsc"
]
}


Then, under the Template directory of Examples\Override I place the rsc files called for by my override.  I keep running BuildOverride.bat until I get everything in Examples\Override that is called for by the error messages, aside from sound, models, and graphics.  The missing files should be placed in the same location relative to the Template directory as they are under Resources.  Eventually there is an override.pgm under bin\WinData.  I move this to the regular game directory and try running it.  If it works, I rename override.pgm to the appropriate name and also rename the Examples\Override directory to the same name.

Why do I do it this way?  I do it this way because I can't edit batch files in the working directory, but I can edit rsc files with PFE running in admin mode.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 11, 2014, 09:28:07 AM
Thank you so much, both of you. I've always been a RTFM kind of guy but I'm lost without a FM to read.

So I followed instructions as closely as I could and wrote a batch file with both commands it it. When I ran the batch file from the command line it started working quite happily but then came a cropper. It complained: "Can't build resource from 'Dialog\Work.rsc:enable WorkCheck'! @slink had mentioned moving files into the NoIdle folder as error messages cropped up, so I copied Work.rsc from the dialog folder into the NoIdle folder and tried again. Got the exact same error message.

Hmmm. Clearly I need to respond in some way to what the program wants, but I'm not quite sure what it wants.

I used to tell my theology students who were having trouble coping with computers, "Remember, computers are like Fundamentalists. They interpret everything literally." So, what exactly is my computer interpreting literally that I don't see? Do I need every file that Work.rsc calls in the NoIdle folder?

Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 11, 2014, 09:42:51 AM
welcome in the Blind Moddler world ^^. we all like that , we are blind, without any manual, any parameters list and we try to go from there. and we try to guess what the computer think ^^
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: slink on September 11, 2014, 11:13:51 AM
I believe that work.rsc is in the Dialog directory.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 12, 2014, 11:09:59 AM
I've always thought of myself as a moderately intelligent individual and open to learning, but holy (expletive deleted) this mod kit is driving me around the bend. I ended up copying a whole whack of other files into my mod folder and things moved along much further. Then Tools-x64 started wanting graphic files (.png and .fbx), couldn't find them and quit cooperating. I looked all through all my ModKit folders and only found .pngs for the fonts. Where are the other graphics files hidden? I see them in the examples stashed away in the Material Instance folder (which is where the program is looking for them), but the Material Instance folders for the Doctor House or Herbalist do not have any graphics files in them. Where are you, graphics files? Come out, come out wherever you are.

Thank goodness I had a student by for a directed study today and could feel competent at something.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 12, 2014, 11:20:39 AM
they are already in the data0.pkg

you dont need to copy everything.

and also when you do a external .rsc call you can direct it right where you need to
example: \Template\TradingPost.rsc:Trade
so you dont have to make compile everything :)

also , make sure you modify the very 2nd word of the package.rsc, totally on top of the notpad. i ve lost like 4 hrs yesterday trying to understand why it didnt want to compile and package my general good boat fix ^^.

the Tools is very mean sometimes ^^
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 12, 2014, 02:48:35 PM
Want to test that @Bobbi ?

;D ;D ;D
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Bobbi on September 12, 2014, 03:42:45 PM
OMG, you are an animal, @RedKetchup! And you even named it after me....   ;)  Of course I test. Is it the idling or also contagion?
Now how about that small church I want?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Bobbi on September 12, 2014, 03:45:18 PM
Running off to play. I will check back in later.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 12, 2014, 04:20:10 PM
just the idling. i did what i told you, deleted the happiness
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 12, 2014, 04:25:06 PM
till @graphite doesnt make some tuto about .fbx and the game requirements about what the game is expecting to find inside a .fbx .... i cant make new building. i only can take the apiary and modify it a bit. delete some items, rotate scale bigger or smaller .... move things around but thats about it. cant change colors, nor add a piece of wood to it.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 12, 2014, 04:27:16 PM
whats about the contagion ?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Pangaea on September 18, 2014, 02:21:44 AM
Quote from: RedKetchup on September 12, 2014, 04:27:16 PM
whats about the contagion ?

Do you know if it's possible to alter this, so that people walking by the hospital won't be infected by people inside it?

I suspect the game just uses a blanket range for each disease, so it's either a case of them working like now, or effectively removing the diseases form the game by removing (or harshly reducing) the range at which they can infect others.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 18, 2014, 07:27:56 AM
Quote from: Pangaea on September 18, 2014, 02:21:44 AM
Quote from: RedKetchup on September 12, 2014, 04:27:16 PM
whats about the contagion ?

Do you know if it's possible to alter this, so that people walking by the hospital won't be infected by people inside it?

I suspect the game just uses a blanket range for each disease, so it's either a case of them working like now, or effectively removing the diseases form the game by removing (or harshly reducing) the range at which they can infect others.

The game does indeed use a number for each disease's contagion radius--it's in the .rsc file that lists all the diseases and gives their specs. It could be changed like any of  the other .rsc files. The problem comes if you want one contagion radius before they get to the hospital and a different one after. The game does not seem to be able to do that. I was hoping otherwise (It really does seem like cheating to take away the contagion radius altogether), but it is not to be.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Pangaea on September 18, 2014, 10:06:42 AM
I was afraid of that. Better to keep it is as it is then, as removing the radius of all would pretty much remove them from the game I would think.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 18, 2014, 10:12:23 AM
we need to keep a certain amount of challenge. and i think, just the hospital radius was a HUGE chunk of nerfing it and we should not go any further
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 18, 2014, 03:40:55 PM
Quote from: RedKetchup on September 18, 2014, 10:12:23 AM
we need to keep a certain amount of challenge. and i think, just the hospital radius was a HUGE chunk of nerfing it and we should not go any further

Exactly!
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Pangaea on September 21, 2014, 02:26:36 AM
Quote from: RedKetchup on September 10, 2014, 10:59:19 AM
the first line compile everything into binary files : it makes your /bin directory and put all your line into binary files aka .crs (your line codes are in txt .rsc)

the second line take all the binary files and do a package with it ( aka your .pkm package)

so if you put your files are in \example\NoIdle

then your .bat should look :


bin\Tools-x64.exe /build NoIdleResources.rsc /pathres ../example/NoIdle /pathdat ../example/NoIdle/bin
bin\Tools-x64.exe /mod Package.rsc:noidle /pathres ../example/NoIdle /pathdat ../example/NoIdle/bin


and your dir \example\NoIdle should look like:

Package.rsc
NoIdleResources.rsc
icon.png

and have a dir called \Template


in \Template dir you should have your modified files like the doctorhouse.rsc and everything you also added
your NoIdleResources.rsc should call your doctorhouse.

Thanks for the explanation. However, what I am struggling with is that not all files are converted to *.crs with that first line. Only e.g. "Package_stuff.crs" is created, not the other files such as "Template/Woodhouse_build.crs" and a host of others. This, then, means I can't create the actual pkm file. It does happen when I run a batch file that starts the game, but I have to start a new save there first. I want something quicker as it quickly gets tedious.

Quote from: slink on September 10, 2014, 04:32:08 PM
I use a single batch file named BuildOverride.bat.  It's contents are as follows.

bin\Tools-x64.exe /build Package.rsc:list /pathres ../example/Override /pathdat ../example/Override/bin

bin\Tools-x64.exe /mod Package.rsc:override /pathres ../example/override /pathdat ../example/override/bin


Then, in a directory under Examples I have Package.rsc, for which an example follows.

PackageFile override
{
String _name = "Immortal Orchard Trees Override";
String _author = "SJGL";
String _description = "This mod makes the standard eight orchard trees live forever.";
int _userVersion = 1;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"
]
}

ExternalList list
{
External _resources
[
"Template/NaturalResourceAppleTree.rsc"
"Template/NaturalResourceCherryTree.rsc"
"Template/NaturalResourceChestnutTree.rsc"
"Template/NaturalResourcePeachTree.rsc"
"Template/NaturalResourcePearTree.rsc"
"Template/NaturalResourcePecanTree.rsc"
"Template/NaturalResourcePlumTree.rsc"
"Template/NaturalResourceWalnutTree.rsc"
]
}


Then, under the Template directory of Examples\Override I place the rsc files called for by my override.  I keep running BuildOverride.bat until I get everything in Examples\Override that is called for by the error messages, aside from sound, models, and graphics.  The missing files should be placed in the same location relative to the Template directory as they are under Resources.  Eventually there is an override.pgm under bin\WinData.  I move this to the regular game directory and try running it.  If it works, I rename override.pgm to the appropriate name and also rename the Examples\Override directory to the same name.

Why do I do it this way?  I do it this way because I can't edit batch files in the working directory, but I can edit rsc files with PFE running in admin mode.

This seems to work better, finally. I see what RedKetchup wrote many places, but it simply does not work on my end. Putting all the changed files into the list in Package.rsc seems to thankfully work, as then I'm able to build the *.crs files.

Can't believe I've wasted many hours just trying to figure this out, after somehow doing it earlier today. Just managed to funny-mod in a special woodhouse, so here's hoping I know the way to do this in the future as well. Just have to keep in mind to add all the files in the list in Package.rsc. This really ought to be in war fonts somewhere, grrr  ;D
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 21, 2014, 05:23:55 AM
if something hasnt been packaged, it s cause you didnt called it. somewhere inside all your .rsc texts ... somewhere, you should have called those.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Pangaea on September 21, 2014, 06:31:13 AM
Quote from: RedKetchup on September 21, 2014, 05:23:55 AM
if something hasnt been packaged, it s cause you didnt called it. somewhere inside all your .rsc texts ... somewhere, you should have called those.

Don't think so. I'm not into advanced stuff like you are, I'm just modifying the default game files, changing a number here and there. According to the README, that /build command is supposed to get dependencies too, which I suppose all the rsc files are. But all that gets made (without the list stuff) is the main file (for example Package_orchard.crs) , not the stuff in subfolders.

A little more work to write down all the files that have been changed in that list function, but as long as that works I at least have a way to mod.

Don't you do any of that then? Just edit your files, copy them to your mod folder with the same folder structure, and then run the /build command and all works out?
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: RedKetchup on September 21, 2014, 07:58:37 AM
not necessairly same folder structure, you still can chnage their path, but ya. you copy those in your folder, modify them and compile.
you can also directly shortcut them if it s something small like :

/Template/TradingPost:trade

the :name will make it go directly where you want to go without have to care of other stuff inside in the file.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Pangaea on September 21, 2014, 09:20:33 AM
Quote from: RedKetchup on September 21, 2014, 07:58:37 AM
not necessairly same folder structure, you still can chnage their path, but ya. you copy those in your folder, modify them and compile.
you can also directly shortcut them if it s something small like :

/Template/TradingPost:trade

the :name will make it go directly where you want to go without have to care of other stuff inside in the file.

That's actually what I ended up doing in the two rudimenatary mods I've made so far, as I only need :growth and :build from the two files I'm using. But I've written that in the ExternalList section. Does my head in that I can't get the normal command to work. I don't have your modding skills to make wholesale changes, new buildings, material, animatation and whatnot though, so I'll only make changes to a few each time, so it's not a huge deal. Would have been a nightmare if I were working with hundred files for instance.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: Bobbi on September 21, 2014, 01:59:30 PM
I would like to present the BobbiHospital where no idling is done on the beautiful grounds, all credit for which goes to @RedKetchup
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: irrelevant on September 21, 2014, 02:38:43 PM
Brava and bravo! Love this mod, it's a keeper.
Title: Re: No Idling in hospitals, and maybe a small clinic?
Post by: rkelly17 on September 22, 2014, 09:19:58 AM
Quote from: Bobbi on September 21, 2014, 01:59:30 PM
I would like to present the BobbiHospital where no idling is done on the beautiful grounds, all credit for which goes to @RedKetchup

[emoticon of someone drooling in envy] Stunning! And the citizens stay away in droves!