[1.5] HugsLib (11.0.3) Lightweight modding library

Started by UnlimitedHugs, December 15, 2016, 02:20:14 PM

Previous topic - Next topic

UnlimitedHugs

Quote from: Rock5 on December 01, 2017, 04:03:13 AM
Ah, I see what I did wrong. I thought I had to change the HugsLib. references in the file to my mod name. Anyway, I've changed them back and it worked.
Thanks for your help.

Happy to help :)
HugsLib - AllowTool - Remote Tech - Map Reroll - Defensive Positions: Github, Steam

Torann

Ive just started using HugsLib and I'm having trouble getting adjustable mod settings to save or to reference those settings elsewhere in the mod.
I can adjust the setting values in the mod options and they appear to save, but anytime I reference those values, I always get a return of the "default" value, ie the value I have hardcoded when initiating the variable:
public float pawnDeathChance = 0.67f;
public float animalDeathChance = 0.47f;


I've tried leaving the value unspecified, but all that seems to do is give me whatever the field held before i make the change.
I'm trying to reference these values from within a harmony prefix:
public static bool Prefix(Pawn_HealthTracker __instance, DamageInfo?, Hediff hediff)
{
..
Settings CDR = new Settings();
float num = CDR.pawnDeathChance;
..
}


I've been struggling with this for awhile, so I figured I'd just ask to see if anyone had any thoughts.  I get the impression each time the prefix is called, it creates a new instance of Settings with the default variables.  Not sure if that's right though, so any help on what I need to look for would be appreciated.

UnlimitedHugs

Quote from: Torann on December 06, 2017, 12:54:26 AM
Ive just started using HugsLib and I'm having trouble getting adjustable mod settings to save or to reference those settings elsewhere in the mod.
- snip -

Hello! I'm not convinced it is the HugsLib settings you are trying to implement.
Did you take a look at the Adding Mod Settings wiki page?
HugsLib - AllowTool - Remote Tech - Map Reroll - Defensive Positions: Github, Steam

Fluffy (l2032)

Also, you probably shouldn't be creating the Settings object inside the actual prefix. Use a static class with all the initialization required (shouldn't be much), then reference that.


Harry_Dicks

Does it matter if you load this before or after Jecs Tools? Is there a sort of "general" load order that people go by? For example, Core->HugsLib->JecsTools->AlienRaceFramework->Certain mods that need to be early->User Interface->Bundles of mod groups->Small QoL mods->big content mods->small content mods->certain mods that need to go towards the end

Any help would be greatly appreciated, up to 280ish mods, and I finally got it down to only a few yellows and 1 red error. I've honestly been working on all the mods for about an hour a day over the past 5-6 weeks, starting from 0!

SpaceDorf

Quote from: Harry_Dicks on January 01, 2018, 03:05:05 PM
Does it matter if you load this before or after Jecs Tools? Is there a sort of "general" load order that people go by? For example, Core->HugsLib->JecsTools->AlienRaceFramework->Certain mods that need to be early->User Interface->Bundles of mod groups->Small QoL mods->big content mods->small content mods->certain mods that need to go towards the end

Exactly Like you said with following addition :

Mod-E -> Core -> HugsLib -> ModSwitch -> JecsTools ->AlienRaceFramework -> ArchitectSense -> AllowTool ->

( basic must have modlist )

later I just tack on what I find interesting, and I am down to a few warnings and no errors.

Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

bravelittletoreador

Hi, could I get a quick 'Hugs for Dummies?' I'm not a modder, but a mod I want to use (Children and Pregnancy) needs it and I can't figure out how to install it.
The first post doesn't have any information on how to add it except that it doesn't go in the mods folder. I tried just dumping the contents of the RimworldHugsLib-master folder in my root Rimworld folder (since several folder names matched I figured it was a solid guess) and hugslib showed up properly in the mods in game, but I couldn't start a new colony. When I try to generate a new world it just thinks for a minute and then dumps me back on the create world page. It kept doing that even after deactivating all mods. I had to do a clean install to get it to run properly again, so I can only assume copying over the hugslib folder that way overwrote something it shouldn't have.
So, clearly, I'm an idiot. Can you explain where I'm supposed to put the hugslib folders to me like I'm five?

Kori

HugsLib needs to be installed like any other mod in the mods folder, you can also subscribe it on steam.
The only important thing is that it should be the first mod in your load order. :)

bravelittletoreador

I think I figured out what dumb thing I did =w=; I clicked the 'clone or download' button on github instead of directly on the zip file. I don't use github often and I am, as previously mentioned, an idiot. I have what I think is the correct file now, so I'm going to slink away in shame.
It might be advantageous in the future to add a short little install section to the first post for nervous idiots like me. something like "Install directions: 1. Goes in the mod file like any other mod. 2. Make sure you have the right file and not the source code. 3. Don't be an idiot."

wwWraith

Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

Kori

 ;D
There is an About folder in every mod. When everything is installed correctly, this folder's path should look like this:
RimWorld\Mods\HugsLib\About

Harry_Dicks

Quote from: bravelittletoreador on February 20, 2018, 02:26:31 PM
and I am, as previously mentioned, an idiot.

You stop that right now, mister. If anyone's the village idiot around here, it's ME dammit!

Canute

bravelittletoreador,
follow the download link from the first posting, and don't download the master.

UnlimitedHugs

Quote from: bravelittletoreador on February 20, 2018, 01:54:21 PM
- snip -

Don't be so hard on yourself :) This can be tricky and this question does come up fairly often.
I've added a section to the main post with some pointers.
HugsLib - AllowTool - Remote Tech - Map Reroll - Defensive Positions: Github, Steam

FrodoOf9Fingers

Hey, can this be used with a different version of Harmony that is not bundled with HugsLib?