Jump to content

making a single prefab spawn in a very large area (need help!)


Recommended Posts

Hello, as most of you know I am making an awesome jungle biome mod!!! though I have a problem...
I need to be able to make 1 of an item spawn inside the huge biome! but it just gets multiplied!
 

 
GLOBAL.require("map/tasks")
GLOBAL.require("constants")
AddRoom("jungle", 
{
colour={r=0.3,g=0.2,b=0.1,a=0.3},
value = GLOBAL.GROUND.SINKHOLE, 
contents =  
{
countprefabs= 
{
wasphive = 1,
spiderden = 1,
pond = 1,
}
}
})
 
local task = GLOBAL.tasks.GetTaskByName("Forest hunters", GLOBAL.tasks.sampletasks)
task.room_choices["jungle"] = 15

current "room" code

 

my problem is that these things will be multiplied by 15!!! and yes I've tried decimals and fractions... it just makes nothing at all spawn....

 

so if anyone knows how I can get a single thing to spawn in the large area please let me know! thankyou so much for your help!!!

Link to comment
Share on other sites

that'll make the biome SUPER small.......

Herm. My only guess is that the spawn rate is across segments of the "room", or that the room is treated as a segment of the in-game biome. Is it possible to make a 1/15 chance for something to spawn?

(Wow, this is confusing.)

Link to comment
Share on other sites

Herm. My only guess is that the spawn rate is across segments of the "room", or that the room is treated as a segment of the in-game biome. Is it possible to make a 1/15 chance for something to spawn?

(Wow, this is confusing.)

"and yes I've tried decimals and fractions..." so yeah I still don't know what to do...

Link to comment
Share on other sites

I would suggest creating a custom setpiece to hold the object you want one of, and setting the amount of that setpiece that can spawn in your biome.  That should work, but if it doesn't feel free to tell me and I'll try to help more.

I wouldn't know how to do that...

if you wanna help I would love you

Link to comment
Share on other sites

Here you go:

http://forums.kleientertainment.com/topic/32602-tutorial-making-a-custom-setpiece/

Sorry if it's hard to follow, but I hope it helps.

thanks! but I have decided that I will make the jungle act like caves do... and you can teleport from your first world to the jungle world and back again! so I have been trying to learn how saves and loads work xD

Link to comment
Share on other sites

Will you get to it by wormhole?

a special green planty type wormhole and when you take the wormhole the game will load the new jungle world! :razz:

then you can take a wormhole back home! :grin:

either that or I have to make a new task..... :o

which won't make it a separate world just a biome in the normal world

Link to comment
Share on other sites

Ah, I see.  It just so happens that I've also created a mod world that I can share parts of the code for.  I'd rather not reveal what the mod actually IS yet, because it should be a surprise.  The code DOES have some kinks that need to be worked out.  For example: the player's inventory isn't kept when you are brought to the new world.  For the most part, however, the code works.

 

EDIT:  The code is actually fairly buggy still.  Probably shouldn't use it...  To point you in the right direction, though, I would suggest looking at the maxwell boss fight mod.  That makes a new level.

Link to comment
Share on other sites

Ah, I see.  It just so happens that I've also created a mod world that I can share parts of the code for.  I'd rather not reveal what the mod actually IS yet, because it should be a surprise.  The code DOES have some kinks that need to be worked out.  For example: the player's inventory isn't kept when you are brought to the new world.  For the most part, however, the code works.

 

EDIT:  The code is actually fairly buggy still.  Probably shouldn't use it...  To point you in the right direction, though, I would suggest looking at the maxwell boss fight mod.  That makes a new level.

hah I been looking in that for a while... I could help work out the bugs you have by pointing you to cave_entrance.lua when using that the player keeps his items so there must be something in there telling the player to keep his items

Link to comment
Share on other sites

Ah, I see.  It just so happens that I've also created a mod world that I can share parts of the code for.  I'd rather not reveal what the mod actually IS yet, because it should be a surprise.  The code DOES have some kinks that need to be worked out.  For example: the player's inventory isn't kept when you are brought to the new world.  For the most part, however, the code works.

 

EDIT:  The code is actually fairly buggy still.  Probably shouldn't use it...  To point you in the right direction, though, I would suggest looking at the maxwell boss fight mod.  That makes a new level.

BTW could you add me on steam or on the forums so we can pm back and forth? and then you can keep your mod more secret that way...

 

EDIT: oh I found you on steam and added you! :p

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...