Jump to content

Integration of teleportato component into ancient gateway

Recommended Posts

Hello Serp, so I think I could probably integrate the telejump component into the ancient gateway. However, there are some issues with my integration of the component into the mod. The first is the shard issue - from my understanding of the telejump component, it does a check that the shard is the mastershard. The telejump component also checks for parts fitted into the teleportato, of which I will only have one part, that being the atrium key. I also want to add in extra lines of code that will account for chest slot, head slot, and hand slot, which are currently dropped in your code. Obviously, I'd like for you to get the credit you deserve for your work, as most of the functionality would be based off of what you previously worked on. For some parts, I could postinitialize parts of your mod, like taking into account body slot, head slot, and hand slot items whenever the mod saves the data. But for other stuff, like the whole checking for parts fitted into the teleportato, might be a bit tougher to deal with. So, how would you like me to proceed?

Link to comment
Share on other sites

Hi :)
(link to my mod 
link to tutorial how to add your own stuff https://forums.kleientertainment.com/forums/topic/111396-tutorial-adventure-add-your-own-worlds/ )

so I think it is best if you first describe exactly what your mod should do. I still don't understand it 100%.

From what I think I understand so far:
a) You want the ancient gateway work like a teleportato, so worldjumping to a new world. -> in my adventure mod you can also jump with maxwells door in the first world, so the teleportato or the parts are not mandatory. It should be possible to replace it easily with the ancient gateway.
b) Since this gateway is within caves (non master) and my mod currently only allows worldjumping on master shard (forest) we need an adjustment here, right? -> I can add this to my "API" to allow this.

Open questions:
1) What kind of worlds should be generated when worldjumping with the gateway?
1.1) Should the previous world be destroyed and a new world generated, like my mod currently does? Or do you want to create new worlds that exist next to each other (more shards), which would be beyond my knowledge?
1.2) And how should the worlds look like? Are they just a random world/based on game settings ? Or are they predefined worlds, like in my adventure mod?
2) at the mod page you mentioned "health caps" no clue what you mean by this: Max health for mobs? Or for players? And what will these caps do or are they a requirement?
3) What do you mean by "body slot" and those equipment slots? For what purpose do you "take them into account"? As requirement of jumping to the next world is possible? Or are you talking about transfering items to the next world?

Please tell me more about your plans. Only then I can decide if I add the needed changes on my side to the API (see tutorial above) or if they are by far too much and we need another solution.


Edited by Serpens
Link to comment
Share on other sites


Thanks for the in depth reply! To address points a and b,

a) You're entirely correct, thanks for pointing that out. I didn't realize that that check could be bypassed, but upon looking at it again, it is more obvious.-

b) Yeah, I would need to be able to telejump in the non-master shard. It should be an easy-ish change though I imagine.

 To get into the meat and potatoes of what I am planning on working on, 

1) I am hoping to create an almost API, where players can progress through world after world, facing new challenges in each world. Right now, my scope is limited to variations on survival worlds, such as Uncomp, Island Adventures, Conquer the Constant, etc., where each time you world jump, worldgen components of previous mods will be disabled, and the worldgen of a new mod will be enabled, effectively making it like a pseudo adventure mode. Eventually, I will try to add in compatibility to new gamemodes, like the gorge and forge, but that is far in the future.

1.1) Yeah, the previous world will be destroyed.

1.2) I will have the mod use default world settings for worlds players can jump to

2) From what I remember of playing adventure mode, whenever you world jump, max health lowered due to being telltale hearted as a ghost is removed. I might be completely off base here, but that's just what I remember.

3) Yeah, I am referring to transfer of items. So, people won't drop their backpack when they jump, for instance.

I think those are the big parts. Based on your changes to the API, I don't think I would need to create a new component to fix this, although I might need to create a couple widgets for new text, but that's w/e. I'll get to work on it right now, thanks!

BTW, here were a few of the lines I was adding to the telejump component:

  1. -- Added in the function OnPlayerSpawn
  2. table.insert(savedequips, hopdata.equip_data.items)
  3. player.components.equip:OnLoad(jumpdata.equip_data, jumpdata.equip_references)
  4. jumpdata.inventory_data.equip = savedequips
  6. -- In the function SavePlayerData
  7. healthpenaltypercent = pl.components.health and pl.components.health:GetPenaltyPercent() or 1
  8. stats_data["deltapenalty"] = healthpenaltypercent

There were a couple other changes I made to it, but those were the ones that I would really need. Plus just removing the check to see if it was mastershard. What I did was remove that check and in the communicate with the caves function, I changed it so that the currently occupied shard was shard one, and shard two was whichever other shard was generated.

Does this answer your questions?

Link to comment
Share on other sites

Thanks, you should REALLY read all of my text in the tutorial linked above. I think nealry everything (except jumping within cave) can be done this way, without copying modifing anything of my code.
For example the last post in this tutorial describes how you can save and load your personal "jumpdata". So you could save and load the equip slots this way, regardless of my code elsewhere.
And the first post in that thread describes how you can create predefined worlds the player will hop one after the other (just like in adventure mod).


where each time you world jump, worldgen components of previous mods will be disabled, and the worldgen of a new mod will be enabled

do you already know how to do that? I'm not aware of a way to achieve this, without copy/pasting alot of code from that mod.

Edited by Serpens
Link to comment
Share on other sites

I don't know if my message got deleted or something, but basically what I said was that I think I know of a way to do this. I can get back to you when I have more details, but the idea is that you can disable all mods on worldgen except one, allow worldgen to occur as normal, and then re-enable mods prior to players spawning in, and on spawn, players won't crash due to unrecognized prefabs. The pseudocode I have right now makes sense, but I need to figure out how to implement it.


And yeah, I need to give a more in depth read into your guide! Thanks so much!

Link to comment
Share on other sites

Regarding starting worldjumping within caves:
I'm no shards expert and it is too long ago to remember all consequences... Not sure if some code is only possible at master server or what the reason was for only adding worldjump component to the master server...

So if you are no expert on it as well, I would suggest to try workarounds. So either give the player in caves an item/recipe that they need to enable on the master server. Or use some  slave to master communication code, so the Gateway in caves notifies the master server to start the worldjump (in this case you would need GEMAPI mod, to make sure the jumpdata from players in caves is saved)

  • Like 1
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

  • Create New...