Post Reply 
 
Thread Rating:
  • 9 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[MOD] Removing The Population and Limits
Author Message
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #61
RE: [MOD] Removing The Population and Limits
I don't know where you installed Tropico 4. I can't help beyond what I've already posted on locations.

If you mean the HPKs, they're still where the links point.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
01-01-2012 06:29 AM
Find all posts by this user Quote this message in a reply
CoconutKid Offline
Has Been or Never Was?
*******

Posts: 2,011
Joined: Nov 2008
Post: #62
Question RE: [MOD] Removing The Population and Limits
Content removed. I should have asked the question in another thread.

Wink
(This post was last modified: 02-01-2012 04:24 PM by CoconutKid.)
01-01-2012 09:29 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #63
RE: [MOD] Removing The Population and Limits
At this point in time anything except entities/models can be modded into, or out of, the game.

Though arguably you can just disable entities. I'm not working on anything specific at the moment, due to a high study workload beginning in a week or two, but I am looking into resolving the entity loading problem through Lua's C-API (and signature scanning and some very nasty code).

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
01-01-2012 09:50 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #64
RE: [MOD] Removing The Population and Limits
i love this mod...(5k version woorks fine without any issures')

but:/ now i have modern times and it dont work anymore...
again roadlimit and populationlimitSad ...argsSad

can you please update?

thx
(This post was last modified: 31-03-2012 06:31 PM by terr.)
31-03-2012 03:27 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #65
RE: [MOD] Removing The Population and Limits
Does it still work when you play an old sandbox map or the original campaign?

My *personal* version of this mod works, but it's never going to be released because it causes many instabilities.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
(This post was last modified: 31-03-2012 10:01 PM by Swixel.)
31-03-2012 10:01 PM
Find all posts by this user Quote this message in a reply
DocMadfox Offline
Junior Member
**

Posts: 10
Joined: Mar 2012
Post: #66
RE: [MOD] Removing The Population and Limits
Playing on the Steam version and it seems to have stopped working for me as well. Loading up my last pre-MT game it seems to be sitting around 1620 population rather than growing.
31-03-2012 11:03 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #67
RE: [MOD] Removing The Population and Limits
Neat. The loading mechanism for the expansion is a mystery, and this is a problem ...

I'll see if I can get some time today to put together the basis for my mod SDK and hack a fix into play.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
31-03-2012 11:06 PM
Find all posts by this user Quote this message in a reply
Nineballfool Offline
Newbie
*

Posts: 6
Joined: Mar 2012
Post: #68
RE: [MOD] Removing The Population and Limits
I tried moving the file to different directories....that didn't work either.

i miss the 5,000 limit mod and the Metropolis mod.
31-03-2012 11:37 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #69
RE: [MOD] Removing The Population and Limits
As an update, I know why it's broken, I think I know how it can be fixed, but I haven't the time to clean up my own code.

I tried removing some stuff and my detour throws access violations (for obvious reasons). I haven't really got the patience to decouple the logger from my hacky code at the moment, so I'll fix this when I get the time.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
01-04-2012 06:43 AM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #70
RE: [MOD] Removing The Population and Limits
swixel i hope you get time soonBig Grin

nice you find the issure so i m happy to know that the update comes ...( not todaySmile because you haven t time but it comesBig Grin.)..thx a lotSmile
(This post was last modified: 01-04-2012 01:31 PM by terr.)
01-04-2012 01:29 PM
Find all posts by this user Quote this message in a reply
DocMadfox Offline
Junior Member
**

Posts: 10
Joined: Mar 2012
Post: #71
RE: [MOD] Removing The Population and Limits
Good to know you're sure of what's wrong and what to do at the very least. Can't wait to have the fix, thank ya sir.
01-04-2012 02:57 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #72
RE: [MOD] Removing The Population and Limits
swixel when you think yu get time?Big Grin
i dont wanna stress you heheh...... i only willl say that the game without your mod ..is only half...fun...

soooSmile...i cant whait for it hehhehe
04-04-2012 04:20 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #73
RE: [MOD] Removing The Population and Limits
Well I'm about half way there to making a semi-useful modkit base. On the systems I've tested I can now get data to load again (though building modding is right out in the way we used to mod it).

Earliest I'd imagine I'll get time to finish it to the point where this could be 'fixed' to work again is the weekend ... sorry.

EDIT: And this is *just* loading settings and functions, nothing flashy like buildings. I'm thinking of adding a legacy mode to load old (now broken) mods.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
(This post was last modified: 04-04-2012 08:28 PM by Swixel.)
04-04-2012 08:28 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #74
RE: [MOD] Removing The Population and Limits
why sorry?

so fast? Oo nice
(This post was last modified: 05-04-2012 02:58 AM by terr.)
05-04-2012 02:57 AM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #75
RE: [MOD] Removing The Population and Limits
Ditched my plans to make a complex pile of code and to hide things ... pretty much over nobody else looking into it, so I'm just dumping what I've been using.

See the first post for the code that bypasses the clobbering.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
06-04-2012 07:01 AM
Find all posts by this user Quote this message in a reply
DocMadfox Offline
Junior Member
**

Posts: 10
Joined: Mar 2012
Post: #76
RE: [MOD] Removing The Population and Limits
Will you still be working on the other route for the mod? Because as embarrassing as it is...

[Image: i-have-no-idea-what-im-doing-dog.jpg]
06-04-2012 08:07 AM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #77
RE: [MOD] Removing The Population and Limits
Make a folder called "Game" in your Tropico 4 directory.

Take the code from the first post, save it into the Game directory, naming the file nolimits.lua

Then launch Tropico. The population limit is defined in the code, as are the game entity limits (the game will crash if you pass the entity limit, which is why I've set it to 200,000 for a 20,000 population limit).

It should work for both T4 and T4:MT because it late loads.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
06-04-2012 08:12 AM
Find all posts by this user Quote this message in a reply
DocMadfox Offline
Junior Member
**

Posts: 10
Joined: Mar 2012
Post: #78
RE: [MOD] Removing The Population and Limits
My thanks, it worked. Sorry for bothering you about the specifics, I can be a bit off at times and I wasn't sure if notepad would work of if python was needed.
06-04-2012 08:22 AM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #79
RE: [MOD] Removing The Population and Limits
That's Lua ... anyway, the game executes uncompiled code fine. This sort of modding is pretty trivial (at least at the most basic tweak level).

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
06-04-2012 08:24 AM
Find all posts by this user Quote this message in a reply
rafaragao Offline
Newbie
*

Posts: 1
Joined: Apr 2012
Post: #80
RE: [MOD] Removing The Population and Limits
(06-04-2012 08:12 AM)Swixel Wrote:  Make a folder called "Game" in your Tropico 4 directory.

Take the code from the first post, save it into the Game directory, naming the file nolimits.lua

Then launch Tropico. The population limit is defined in the code, as are the game entity limits (the game will crash if you pass the entity limit, which is why I've set it to 200,000 for a 20,000 population limit).

It should work for both T4 and T4:MT because it late loads.

I did everything that u said, but still doesn`t work. I created a folder named Game. And saved the code into the game directory but it doesnt work
06-04-2012 06:18 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #81
RE: [MOD] Removing The Population and Limits
finish so fast.?.^^thx!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

first thx...but i have one problem ..it dont change the .txt to .luna it called now nolimits.lua.txt ^^

i use the steam version....
edit..ok now i have it....Big Grin now its nolimits.lua
i use now no specifications if i save...and now i try hehehBig Grin

but first really thx a lot you save my gameBig Grin
(This post was last modified: 06-04-2012 06:56 PM by terr.)
06-04-2012 06:52 PM
Find all posts by this user Quote this message in a reply
arbogli Offline
Newbie
*

Posts: 7
Joined: Apr 2012
Post: #82
RE: [MOD] Removing The Population and Limits
Nice job, I tryed in my own savegame and it made something rare: stay a bit in 1500 and in a second up to 2200, a massive baby boom ^^... and even if the number of workers get increased I still have those tiring message telling that my garages and teamer's office are without workers :S
06-04-2012 07:04 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #83
RE: [MOD] Removing The Population and Limits
and on me dont work..i have 1450 pop and ..stabile...?..

hmm maybe i do something wrong`?

*edit: i try now on 2 differnt selfmade maps.... no dont work srySad

i made in
C:\Program Files (x86)\steam\SteamApps\common\tropico 4 a new folder ..called game..inside i put nolimit.lua

but dont workSad atm i see my max was 1550 pop

edit2: one last idea i have maybe old save dont work with?...so i made new island...and will try there to start with 5000 pop....if its grow upBig Grin..all fine..if not..hmmm..so i dont knowSad

or maybe is the english (witch one you use?) version other to the german..(i have the last)?...but before MT works..so normaly not..
(This post was last modified: 06-04-2012 09:04 PM by terr.)
06-04-2012 07:18 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #84
RE: [MOD] Removing The Population and Limits
(06-04-2012 06:18 PM)rafaragao Wrote:  I did everything that u said, but still doesn`t work. I created a folder named Game. And saved the code into the game directory but it doesnt work

Make sure it's not nolimits.lua.txt, as terr suggested.

If you use the command prompt, cd to the directory. For the Steam users: 1. Copy this: cd "C:\Program Files (x86)\steam\SteamApps\common\tropico 4"
2. Right-click paste into the CMD window
3. cd Game
4. Type in: dir

If it's nolimits.lua.txt
5. move nolimits.lua.txt nolimits.lua

It's also possible playing the older campaign stuff is breaking it, as I haven't looked too far into it. All I know is it works for how I play.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
06-04-2012 08:45 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #85
RE: [MOD] Removing The Population and Limits
1. what you play (selfmade map, campain,sandbox?).. if you try?
2. yea i do i change to nolimit.lua ..the txt was gone if i save under not specific file (thats how it calls in german sry if its wrongBig Grin)
3. atm i try new map...and give it (5000 was too mutch hehe)
4000 pop..i start it and it was stable to 4000 no one comes no one goes (i wonder a bit because was terrible living there ^^ )..

i buil a lot of roads but isnt finish jet but think in 30 min i will get normaly the roadlimit and the poplimit i think i will see this in 2-3 hour if the new map is ready...

but i will than tell you what happend swix


ok first result (in the editor) i build roads roads roads ...crash...but i had a save close before..so will try it again.....but if crash again i think its the file...
(This post was last modified: 06-04-2012 09:52 PM by terr.)
06-04-2012 09:30 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #86
RE: [MOD] Removing The Population and Limits
There's a chance the map is resetting the value if it's a pre-MT map. I don't have any old sandbox saves from pre-MT anymore, because they all got to points of ridiculous populations and the game was too slow to play with 18,000 people Tongue

You could try adding this to the end of the file:
Code:
OnMsg.MapPermanentObjectsLoaded= function()
    NoLimitsMod()
end

That will force the mod to reload every time the map changes. This is one of the hooks I was looking to use for general mod use (so people could switch mods by going to a new menu off the main screen).

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
06-04-2012 09:34 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #87
RE: [MOD] Removing The Population and Limits
local GameEntityCount = 20000
local MaxPopulation = 20000

hmmm...maybe i reache gameentry max ^^ by the roads bcause i change now to lagerSmile (something with 1.5 mio) and now i bult a lot of roads (more as before no crash now...butSmile we will see i havend finished my island jet ..hhihih....atm i have build room for 2000Big Grin...so i neet bit more roadsBig Grin)
but is that possible swix?
but the maxpop i don t tasted jet (only in editor..i will try later play it up toBig Grin). ..but its still 4000 no chrash or slow downSmile



Code:


OnMsg.MapPermanentObjectsLoaded= function()
NoLimitsMod()
end
i will tryBig Grin
and before MT my max i played was ~15000...but later i use only nolimit5k...was not so slowBig Grin
(This post was last modified: 06-04-2012 10:47 PM by terr.)
06-04-2012 10:42 PM
Find all posts by this user Quote this message in a reply
Swixel Offline
Epic Member
*******

Posts: 1,087
Joined: Sep 2011
Post: #88
RE: [MOD] Removing The Population and Limits
The default entity limit is 20,000, so you'll want to raise it anyway. I put 200,000 in mine because you're unlikely to reach 200,000 unless your population is set to a crazy limit (the people add more entities, like cars, and their need for more buildings).

The roads aren't likely to push you beyond what you need either.

"I am not ashamed to confess I am ignorant of what I do not know" ― Cicero.

"You had to hand it to the Patrician, he admitted grudgingly. If you didn't, he sent men to come and take it away." ― Terry Pratchett (Guards! Guards!)
06-04-2012 10:58 PM
Find all posts by this user Quote this message in a reply
terr Offline
Junior Member
**

Posts: 15
Joined: Mar 2012
Post: #89
RE: [MOD] Removing The Population and Limits
but i changend not the max popBig Grin
it look now like
local GameEntityCount = 1500000
local MaxPopulation = 20000

but if its not the reasonSmile ..so i dont know why it crash before was only a ideaBig Grin
but atm it works..
im close to finish the island'Smile and than we see eheh
i hope it goes than up over 4000...

in the editor i say 4000 start pop...Smile

*edit
ok island readySmile aaaand it worksSmile)

Big Grin
(This post was last modified: 07-04-2012 02:30 AM by terr.)
06-04-2012 11:23 PM
Find all posts by this user Quote this message in a reply
arbogli Offline
Newbie
*

Posts: 7
Joined: Apr 2012
Post: #90
RE: [MOD] Removing The Population and Limits
I made a little modification to your mod code, it just don't "create" inhabitants, it just increase the limit. I tested in my MT and it works in a savegame and in a new game (well, in savegame where an issue: even if inmigrants come to my island still get me messages about the no workes, etc. but the inhabitants numers get increased over the time)

Code:
local GameEntityCount = 35000
local MaxPopulation = 35000

-- Original mod code
function NoLimitsMod()
     -- Sets the entity count
     config.MaxGameObjectExCount = GameEntityCount
     config.MaxGameObjectCount = GameEntityCount
    
     -- Remove the road construction limitations
     road_construction.ReachedLimit =  function(x)
         return false
     end

    -- Sets the population
     MigrationMaxCitizens = MaxPopulation

end

-- Only fire once
local FiredOnce = false

-- UA Set Mode
OnMsg.UASetMode = function(actions,mode)

    -- Fire until fired once
     if not FiredOnce then
         -- If we boot, trip it ...
         if(mode == "Boot") then
             FiredOnce = true
            
             -- Run the thread to bypass it
             CreateRealTimeThread(function()

                -- Do mod loading code here.
                 NoLimitsMod()
                
             end)
         end
     end
end
07-04-2012 08:45 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)

Contact Us | kalypso media :: website | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication