Shoutbox

Author Topic: [REL] Gunsmith & Piracy 1.3  (Read 7248 times)

0 Members and 1 Guest are viewing this topic.

Offline McCoy!

  • Supporter
  • **
  • Posts: 1404
  • Reputation Power:
  • Gender: Male
  • Master Thief
    • The Guild 2 - Reniassance Wiki
Gunsmith & Piracy 1.3 Bug Report
« Reply #15 on: 26 March 2016, 00:33:09 »
Owned Buildings you put up for sale will never be sold during the course of the game. This can be traced back to you code somewhere in DefaultCampaign.lua

Very strange but there you have it :P

Offline Teleth

  • Jr. Member
  • **
  • Posts: 101
  • Reputation Power:
Re: Gunsmith & Piracy 1.3 Bug Report
« Reply #16 on: 26 March 2016, 02:07:54 »
Owned Buildings you put up for sale will never be sold during the course of the game. This can be traced back to you code somewhere in DefaultCampaign.lua

Very strange but there you have it :P
Buildings do sell over the course of a game. Tested myself with fresh install of 4.211 + GNP 1.3.
What makes you say that they don't sell?

Offline McCoy!

  • Supporter
  • **
  • Posts: 1404
  • Reputation Power:
  • Gender: Male
  • Master Thief
    • The Guild 2 - Reniassance Wiki
Re: Gunsmith & Piracy 1.3 Bug Report
« Reply #17 on: 27 March 2016, 06:17:11 »
Owned Buildings you put up for sale will never be sold during the course of the game. This can be traced back to you code somewhere in DefaultCampaign.lua

Very strange but there you have it :P
Buildings do sell over the course of a game. Tested myself with fresh install of 4.211 + GNP 1.3.
What makes you say that they don't sell?
Must be incompatible with Legacy then which really doesn't make sense either. Oh well. Anyways I tested 8 rounds and no building sold. Vanilla certainly doesn't take that long. People reporting that their buildings aren't selling. And when I tested myself had the same issue. Anyways took me forever to isolate and finally pinned it down to DefaultCampaign.lua. Removed your code and problem solved :P

If you say it works then I'm sure it does...just not in Legacy which is weird because all of your code was untouched. I don't really understand why that code would affect the sell time anyways but there you have it lol :P

Offline Teleth

  • Jr. Member
  • **
  • Posts: 101
  • Reputation Power:
Re: Gunsmith & Piracy 1.3 Bug Report
« Reply #18 on: 28 March 2016, 03:06:55 »
Owned Buildings you put up for sale will never be sold during the course of the game. This can be traced back to you code somewhere in DefaultCampaign.lua

Very strange but there you have it :P
Buildings do sell over the course of a game. Tested myself with fresh install of 4.211 + GNP 1.3.
What makes you say that they don't sell?
Must be incompatible with Legacy then which really doesn't make sense either. Oh well. Anyways I tested 8 rounds and no building sold. Vanilla certainly doesn't take that long. People reporting that their buildings aren't selling. And when I tested myself had the same issue. Anyways took me forever to isolate and finally pinned it down to DefaultCampaign.lua. Removed your code and problem solved :P

If you say it works then I'm sure it does...just not in Legacy which is weird because all of your code was untouched. I don't really understand why that code would affect the sell time anyways but there you have it lol :P
It only took one round to sell three buildings in G&P 1.3 so something must be interfering with it - I'll give your code a look over if I can find some time.

Offline Teleth

  • Jr. Member
  • **
  • Posts: 101
  • Reputation Power:
Re: [REL] Gunsmith & Piracy 1.3
« Reply #19 on: 28 March 2016, 12:45:29 »
Alright I believe I've worked this one out, it's not actually a bug but a misunderstanding of how CreateShadowDynasty was called (it's used internally so I had no idea). It's not actually related to my building selling mod, but to the dynamic generation of the city.

Basically you just need to remove this line:
RemoveAlias("WorkingHut")

What is happening is I thought CreateShadowDynasty was called per-city and created the top level shadow dynasties - I was creating one building for each dynasty, but not additional people housed in the main building - these spare 'bosses' are the ones who often purchase buildings (outside of AI Dynasties of course). I play with a ton of AI Dynasties so I didn't see it.

You should revert the y count to this also:
Code: [Select]
local CityLevel = CityGetLevel(City)

if CityLevel<=2 then
y = 0
elseif CityLevel==3 then
y = 1
elseif CityLevel==4 then
y = 2
elseif CityLevel==5 then
y = 3
else
y = 3
end
Unfortunately this means there will be less new structures around the city - perhaps I should add a building for every third dynasty member or something.

Remove:
Code: [Select]
if Number == -1 then
        y = 0--king faction
end
It's no longer necessary.

Thanks for bringing it to my attention.

Offline McCoy!

  • Supporter
  • **
  • Posts: 1404
  • Reputation Power:
  • Gender: Male
  • Master Thief
    • The Guild 2 - Reniassance Wiki
Re: [REL] Gunsmith & Piracy 1.3
« Reply #20 on: 03 April 2016, 08:04:41 »
If you decide to update your files I will re-add all this for sure. The problem is mostly not knowing what I'm looking at. Some of that stems as you said from not being able to see the hardcoded functions and some because I am too lazy to follow the math lol

Offline Teleth

  • Jr. Member
  • **
  • Posts: 101
  • Reputation Power:
Re: [REL] Gunsmith & Piracy 1.3
« Reply #21 on: 03 April 2016, 09:39:06 »
Alright I made a legacy 2.02 specific Scripts/Campaign/DefaultCampaign.lua :

http://www.mediafire.com/download/2bc4295r8za8pi3/DefaultCampaign.lua

Also I made a few changes:
Easy difficulty removes the additional workshops which make the economy easier for the player to exploit.
Every 5th or so shadow dynasty member creates a new workshop in attempt to balance the economy for the city it was placed in.

Should the selling bug occur again, it's really a vanilla problem - no one really buys buildings but idle shadow dynasties. You can always increase the number of idle shadow dynasties by increasing that Y number but I can't recommend solving the issue that way.