Jump to content

Spawn Set Piece with 100% chance? (forced)


Recommended Posts

There are a couple of set pieces/traps I would like to spawn with a 100% chance on world regen. How would I edit my .lua for this? Anyone who would like to give me the the correct code?

I assume I use the "modworldgenmain.lua" for this when editing a mod such as this? What code exactly would I add to make the below work?

I would like to force-spawm 1 each of these, the Reed Trap (I know of the mod in the workshop but that one is old code, and it replaces any Sapling with twiggy trees), Large Tallbird Fort, the 3 Mactusk Camp, large Berry-Pigguard Camp and lastly Hound Rocks. 

Link to comment
Share on other sites

13 minutes ago, CarlZalph said:

https://steamcommunity.com/sharedfiles/filedetails/?id=850494968

Take a look at this mod and how it does its magic.

Note that worldgen will do its own thing sometimes even with this mod, due to area claims.

So also take a look at how Klei retrofits things into worlds like the antlion.

Its a bit hard for me to understand. This mod have configs but I am trying to force all those mentioned above once the mod is turned on (no config). So its hard to look at a config mod for guide, because I assume if I remove configs the set pieces become default. I will still try to look at it. 

Is there anyway that you could post a code for "modworldgenmain.lua" that only forces reed trap? Then maybe I could add the others by myself. But anyway if not, I still thank you for trying to help me Carl.

Edited by NamelessName
Link to comment
Share on other sites

6 minutes ago, NamelessName said:

Is there anyway that you could post a code for "modworldgenmain.lua" that only forces reed trap? Then maybe I could add the others by myself. But anyway if not, I still thank you for trying to help me Carl.

https://steamcommunity.com/sharedfiles/filedetails/?id=928691537

Perhaps?  Not sure, I haven't touched much with vanilla worldgen.  Only time I touched worldgen is when I stripped out all of Klei's and replaced it with my own.

Link to comment
Share on other sites

18 minutes ago, CarlZalph said:

https://steamcommunity.com/sharedfiles/filedetails/?id=928691537

Perhaps?  Not sure, I haven't touched much with vanilla worldgen.  Only time I touched worldgen is when I stripped out all of Klei's and replaced it with my own.

Thats the closest there is but that code is old and there are som bugs (in my first post I refered to this buggy version, that twiggy trees seem to spawn instead), BUT it is the best one so far to look at anyway, its doing what I want, for only reed traps but slightly bugged.

EDIT: I wish this game had more proper mod tools. I am modding Age Of Wonders Planetfall as well. Way easier then modding in code.

Edited by NamelessName
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...