Author Topic: How do you add happiness to a building?  (Read 307 times)

0 Members and 1 Guest are viewing this topic.

Offline angainor88

  • Vendor
  • ***
  • Posts: 93
  • Country: us
How do you add happiness to a building?
« on: July 04, 2018, 12:03:02 PM »
I am finishing up a clocktower that I want to add happiness to. I copied the happiness code from the cemetery and added it to the template file. When I Build it, everything runs smoothly, but in game, it crashed whenever I click on the clocktower. What am I missing?

The cemetery code I copied is just:
Code: [Select]
HappinessDescription happiness
{
HappinessType _happinessType = Spirit;
int _idleRange = 1;
}

Offline Tom Sawyer

  • Modders
  • Architect
  • *****
  • Posts: 865
  • Country: is
Re: How do you add happiness to a building?
« Reply #1 on: July 04, 2018, 01:45:07 PM »
Maybe the radius section is missed. You should also add the radius part to the UI section, so it can be seen in game. Can be copied from vanilla market. :)

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9495
  • Country: ca
Re: How do you add happiness to a building?
« Reply #2 on: July 04, 2018, 01:52:08 PM »
happiness function work with radius function.

and you need to call them in the header of your file: (Description _descriptions)

      "happiness",
      "radius",

then explain the functions:

HappinessDescription happiness
{
   HappinessType _happinessType = Spirit;
   int _idleRange = 3;
}

RadiusDescription radius
{
   int _radius = 35;
}
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline angainor88

  • Vendor
  • ***
  • Posts: 93
  • Country: us
Re: How do you add happiness to a building?
« Reply #3 on: July 04, 2018, 04:56:48 PM »
Ah, ok! Thank you so much!

Offline angainor88

  • Vendor
  • ***
  • Posts: 93
  • Country: us
Re: How do you add happiness to a building?
« Reply #4 on: July 04, 2018, 05:58:52 PM »
Oh no, now I get a different error message...

Assert: index >= 0 && index < GetLocationCount(type) Error, index out of range!

Component\InteractComponent.cpp(140)

I... have no idea what this means haha

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9495
  • Country: ca
Re: How do you add happiness to a building?
« Reply #5 on: July 04, 2018, 06:10:31 PM »
 ;D neither !! LOL
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline Discrepancy

  • Modders
  • Architect
  • *****
  • Posts: 913
  • Country: au
Re: How do you add happiness to a building?
« Reply #6 on: July 05, 2018, 07:02:57 AM »
do you have interact points with it? If you are using the spirit happiness code I think it needs to have a use_ point... i think. if you already do, then could you send me your template file to review?

Offline angainor88

  • Vendor
  • ***
  • Posts: 93
  • Country: us
Re: How do you add happiness to a building?
« Reply #7 on: July 05, 2018, 06:09:44 PM »
Ah, that was the missing part of the puzzle! I have build points, but no use points.

Thank you, it works fine now :D

Online RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 9495
  • Country: ca
Re: How do you add happiness to a building?
« Reply #8 on: July 05, 2018, 07:10:24 PM »
well thats great Disc pinpointed it :)
dont forget when you will make some consume produced shops... another dummy you will need to know and add is : create_001 ... create_002 ... create_003 ... etc
they set where the recource should drop on the floor
> > > Support Mods Creation developments with Paypal Donations < < <
Click here to PayPal Donate.

Offline angainor88

  • Vendor
  • ***
  • Posts: 93
  • Country: us
Re: How do you add happiness to a building?
« Reply #9 on: July 06, 2018, 06:00:16 AM »
Yeah the problem was that since it's a building with no workers, I thought I didn't need any points besides build. Whoops haha