[Archived] Original Mod Collaboration Thread


Recommended Posts

Attaching it to OnActivate makes sense. I had fun summoning magic beans with the beefalo horn for a short while, though. :p So I've got a couple of things to say about the world above. Currently, it works like a hybrid between adventure mode and caves. What that means, is that you can climb it, take things from the world, and bring those things back. You cannot, however, bring followers back. Once you leave, though, that world is gone. You can climb the beanstalk again to generate a new world, though, and repeat the process. One of the player benefits to this is that if you die in the world above, you'll respawn near the beanstalk. The problem with keeping the world above persistent seems to be that it's being generated as an adventure world. @Ipsquiggle do you have any suggestions for keeping an adventure mode world persistent?

Weird as it may be, I like that. It's like the particular cloud you had been on has moved on.
  • Like 1
Link to comment
Share on other sites

  • Developer

Attaching it to OnActivate makes sense. I had fun summoning magic beans with the beefalo horn for a short while, though. :razz:

 

So I've got a couple of things to say about the world above. Currently, it works like a hybrid between adventure mode and caves. What that means, is that you can climb it, take things from the world, and bring those things back. You cannot, however, bring followers back. Once you leave, though, that world is gone. You can climb the beanstalk again to generate a new world, though, and repeat the process. One of the player benefits to this is that if you die in the world above, you'll respawn near the beanstalk.

 

The problem with keeping the world above persistent seems to be that it's being generated as an adventure world. @Ipsquiggle do you have any suggestions for keeping an adventure mode world persistent?

 

In SaveIndex:OnFailAdventure() is where it nukes the current level. I was able to make the adventure portal always lead to the same level by changing that function.

 

The first change prevents it from erasing the save, and the second one prevents it from erasing the fact that it has a save.

 

I haven't tested if this kind of change has any wacky knock-on effects, but it fulfills the basic need. :-)

 

You can mod this in using something like this (untested!):

AddGlobalClassPostConstruct("saveindex", "SaveIndex", function(self)  function SaveIndex:OnFailAdventure(cb)    local filename = self.data.slots[self.current_slot].modes.adventure.file     local function onsavedindex()      --EraseFiles(cb, {filename})      cb()    end    self.data.slots[self.current_slot].current_mode = "survival"    --self.data.slots[self.current_slot].modes.adventure = {}    self:Save(onsavedindex)  endend)
Link to comment
Share on other sites

 

In SaveIndex:OnFailAdventure() is where it nukes the current level. I was able to make the adventure portal always lead to the same level by changing that function.

 

The first change prevents it from erasing the save, and the second one prevents it from erasing the fact that it has a save.

 

I haven't tested if this kind of change has any wacky knock-on effects, but it fulfills the basic need. :-)

 

You can mod this in using something like this (untested!):

AddGlobalClassPostConstruct("saveindex", "SaveIndex", function(self)  function SaveIndex:OnFailAdventure(cb)    local filename = self.data.slots[self.current_slot].modes.adventure.file     local function onsavedindex()      --EraseFiles(cb, {filename})      cb()    end    self.data.slots[self.current_slot].current_mode = "survival"    --self.data.slots[self.current_slot].modes.adventure = {}    self:Save(onsavedindex)  endend)

Thanks for trying, but that didn't work.

 

This is the code I'm using to enter the sky level, if it's relevant. It mimics FakeAdventure:

local function BeanstalkAdventure(cb, slot, start_world)    local playerdata = {}    local player = GetPlayer()    local self = SaveGameIndex    if player then        playerdata = player:GetSaveRecord().data        playerdata.leader = nil        playerdata.sanitymonsterspawner = nil            end            self.data.slots[self.current_slot].current_mode = "adventure"        if self.data.slots[self.current_slot].modes.adventure then        self.data.slots[self.current_slot].modes.adventure.playerdata = playerdata    end            self.data.slots[slot].modes.adventure = {world = start_world}    self:Save(cb)end

 

More important though, is that the player's inventory is cleared when they climb the beanstalk. Any ideas?

 

PS: Is it possible to change savegame names? IE "World Above" instead of "Adventure 8-1"?

Link to comment
Share on other sites

So have we decided on the type of land? Is a mix of cloudy areas and land the decision? If so we could add sky sea monsters that swim in the clouds? Coral Crabs? Heavenly Cthulhu (well maybe just a normal octopus mob)? Cloud Sharks?Anyone?No?Okay :(

Link to comment
Share on other sites

I just added player gender recognition for the Shopkeeper (so he can choose between saying "fella" or "darling"). This works both for stock characters and modded ones (as long as the modded character properly configured its gender).

It (and the rest of the mod) can be downloaded from the git repo. Its proportions are modified, so it's best to preview it with the mod. https://github.com/debugman18/UpAndAway/archive/master.zip

Oh yes, GitHub allows downloading the entire repo as a zip, through an automatically updating link. Put it in the OP, to make it easier for everyone here to test the mod (but make it clear it's a link to a "bleeding edge, possibly unstable developmental build"!).And I'll take a look into the savedata/saveindex stuff. I don't quite like the idea of modding the SaveIndex, but so far I think that's our only option.

So have we decided on the type of land? Is a mix of cloudy areas and land the decision? If so we could add sky sea monsters that swim in the clouds? Coral Crabs? Heavenly Cthulhu (well maybe just a normal octopus mob)? Cloud Sharks?Anyone?No?Okay :(

Hang on, we'll get to it.
Link to comment
Share on other sites

So have we decided on the type of land? Is a mix of cloudy areas and land the decision? If so we could add sky sea monsters that swim in the clouds? Coral Crabs? Heavenly Cthulhu (well maybe just a normal octopus mob)? Cloud Sharks?Anyone?No?Okay :(

Why do people always pick Cthulhu. Can't we use a different Lovecraftian abomination?
Link to comment
Share on other sites

I can look at it and try something when I have the time. I never worked with the turfs or the sea. Could be either fun or a disaster ;D

As long as it's a fun disaster! :grin:

 

id be willing to try to make some sky and cloud textures, but do the textures need a particular format?

Sure, feel free to pitch in!

I attached below a zip with the base textures for the sky background (the wave background texture), as well as two tiles (rocky and carpet) to serve as base and example.

The tiles have two texture files: a main one and another that specifies a "noise" texture to be applied over it. For example, the carpet tile uses the following two textures:

The main tile texture atlas:

Posted Image

(the actual file, inside the zip, uses a transparent background, I put a black one here for visibility only)

The noise texture:

Posted Image

We could, in fact, reuse a tile atlas and just do a new noise texture.

tiles_and_background.zip

Edited by simplex
Link to comment
Share on other sites

The tile engine will be opened for modding or you will overwrite game files?

I may be wrong on that (some testing would be good), but I think there's no need to open it further. Creating a new field in the GROUNDS table and inserting the new tile specifications in the ground entry of the table returned by worldtiledefs.lua should take care of it. Edited by simplex
Link to comment
Share on other sites

I may be wrong on that (some testing would be good), but I think there's no need to open it further. Creating a new field in the GROUNDS table and inserting the new tile specifications in the ground entry of the table returned by worldtiledefs.lua should take care of it.

I'm very interested in adding new terrian types, also with some effects like sanity/health drain just by standing on a tile. Just like roads speed you up and creep slows you down.

Also it will be possible to add new creep types that way?

  • Like 1
Link to comment
Share on other sites

I'm very interested in adding new terrian types, also with some effects like sanity/health drain just by standing on a tile. Just like roads speed you up and creep slows you down.Also it will be possible to add new creep types that way?

I'll look into it. After your previous comment, I feel I should run some tests before anything else.
  • Like 1
Link to comment
Share on other sites

  • Developer

Thanks for trying, but that didn't work.

 

This is the code I'm using to enter the sky level, if it's relevant. It mimics FakeAdventure:

local function BeanstalkAdventure(cb, slot, start_world)    local playerdata = {}    local player = GetPlayer()    local self = SaveGameIndex    if player then        playerdata = player:GetSaveRecord().data        playerdata.leader = nil        playerdata.sanitymonsterspawner = nil            end            self.data.slots[self.current_slot].current_mode = "adventure"        if self.data.slots[self.current_slot].modes.adventure then        self.data.slots[self.current_slot].modes.adventure.playerdata = playerdata    end            self.data.slots[slot].modes.adventure = {world = start_world}    self:Save(cb)end

More important though, is that the player's inventory is cleared when they climb the beanstalk. Any ideas?

 

PS: Is it possible to change savegame names? IE "World Above" instead of "Adventure 8-1"?

 

I just realized I made this change as well:

function SaveIndex:StartAdventure(cb)   local function ongamesaved()    self.data.slots[self.current_slot].current_mode = "adventure"    if not self.data.slots[self.current_slot].modes.adventure then      local playlist = self.BuildAdventurePlaylist()      self.data.slots[self.current_slot].modes.adventure = {world = 1, playlist = playlist}    end    self:Save(cb)  end   self:SaveCurrent(ongamesaved) end

I also see in SaveIndex:CompleteLevel there is a line with playerdata = player:GetSaveRecord().data. This is what carries the inventory forward from one level to the next, so you could probably hijack that.

  • Like 1
Link to comment
Share on other sites

What about other cloud-based disasters? How about tornadoes that warp you to a random location below at the sacrifice of health? Snowstorms that freeze you and the animals around you? Rainbows that spit out golden golems and... LEPRECHAUNS? (I think someone had an idea for golden golems at the beginning of the thread, right?

Edited by KidneyBeanBoy
Link to comment
Share on other sites

What about other cloud-based disasters? How about tornadoes that warp you to a random location below at the sacrifice of health? Snowstorms that freeze you and the animals around you? Rainbows that spit out golden golems and... LEPRECHAUNS? (I think someone had an idea for golden golems at the beginning of the thread, right?

I like that snowstorm idea. Give the rainometer some use. When its says its raining, a snowstorm begins and results in RAPIDLY freezing you and freezes creatures too.
Link to comment
Share on other sites

I'm very interested in adding new terrian types, also with some effects like sanity/health drain just by standing on a tile. Just like roads speed you up and creep slows you down.

Also it will be possible to add new creep types that way?

I did it! (and yes, adding creep types is just the same, but I haven't looked into how to add their functionality yet)

Posted Image

There's just one issue, but one I believe can be solved. To add a new tile type, we need to give it an unique numerical id (the value corresponding to GROUND.NEW_TYPE). That value can be generated, by looking at what values are being used and picking the lowest positive value possible. However, this value should remain the same across saves, otherwise tile info will not be loaded properly from the map savedata. So ideally this value should be generated automatically once per world (or even saveslot), from then on being stored as savedata. But I don't know which kinds of savedata are available at worldgen.

TileTest.zip

Edited by simplex
  • Like 1
Link to comment
Share on other sites

I did it! (and yes, adding creep types is just the same, but I haven't looked into how to add their functionality yet)I'll update this post shortly with a screenshot and code.

That's awesome to hear! I'm interested in how you implemented it. I'm off to a friends birthday party shortly, so I won't be able to contribute much tonight. Tomorrow should be pretty productive, hopefully.

 

Today, I changed the new mushrooms into flowers (I think mushrooms are already implemented well, but I noticed a lack of attention to the flowers), name-wise anyways. I'll be working on their functions tomorrow. If one of our artists is interested in making yellow, purple, and orange sky flowers, it's on the list. There would be a normal version, and a static version. (Assuming we plan on implementing the static mechanic, or whatever name we end up giving it?)

 

Edit: I see how you did it. I think that number is also used in scenarios to define ground types.

Edited by debugman18
Link to comment
Share on other sites

I see how you did it. I think that number is also used in scenarios to define ground types.

It is. That number is the most important thing! (it's the resource handle)Do you know what kind of savedata is available at worldgen?
Link to comment
Share on other sites

It is. That number is the most important thing! (it's the resource handle)Do you know what kind of savedata is available at worldgen?

This is the helpful block I can recall at the moment, but I'm sure I've seen it somewhere else. I'll look into whenever I get back home.

 

--called upon relaunch when a new level needs to be loadedfunction SaveIndex:OnGenerateNewWorld(saveslot, savedata, cb)    --local playerdata = nil    self.current_slot = saveslot    local filename = self:GetSaveGameName(self.data.slots[self.current_slot].current_mode, self.current_slot)        local function onindexsaved()        cb()        --cb(playerdata)    end            local function onsavedatasaved()        self.data.slots[self.current_slot].continue_pending = false        local current_mode = self.data.slots[self.current_slot].current_mode        local data = self:GetModeData(self.current_slot, current_mode)        data.file = filename        data.day = 1                --playerdata = data.playerdata        --data.playerdata = nil        self:Save(onindexsaved)    end    local insz, outsz = TheSim:SetPersistentString(filename, savedata, ENCODE_SAVES, onsavedatasaved)    end
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share