Jump to content

Looking for help adding/tweaking a spawn mechanic for a drifter mod.


Thalius
 Share

Recommended Posts

Greetings.

I'm working on a version of a mod that makes drifters more dynamic in their attack and behavior.  One major feature of the mod is that higher tier drifters have a very small chance to spawn anywhere in the world from surface to mantle.

Basically I treat the surface and underground as two halves to the world. Surface drifters spawn anywhere above ground, and deep drifters are the lower world counterpart to surface drifters, spawning anywhere underground down to the mantle.

Tainted through nightmare drifters can spawn anywhere where there is a light level of zero. Tainted are more common (though still pretty uncommon compared to surface and deep drifters), corrupt drifters are rare, and nightmare drifters are very rare.  This sort of makes corrupt and nightmare drifters sort of a mini-boss that shows up from time to time.

The issue is, I want them to show up more often underground while remaining rare on the surface. For that, I need to add code to the mod that enables higher spawn chances underground (and increasing spawn chances the deeper you go, if that does not prove too hard to accomplish). If this parameter could be configurable, that would be fantastic.

I can modify .json files, but I can't write code. If any of you code wizards would be interested and willing to collaborate with me on this particular feature in the mod, I'd be grateful.

~TH~

Editing to add some additional info to give an idea on what I'm working on and why this is such a desired feature for the project:

Via .json editing I've been able to develop drifter attributes that give the following changes:

  • Faster in various, specific ways
  • Unpredictable, with balanced, random leaping attacks that vary by type,
  • Much harder to dodge if one gets too close, but still avoidable if you can learn the timing of the various drifter types' attacks. Running through a pack of drifters without damage is near impossible, and carelessly getting to close to one has a much increased chance of their landing a hit, but even with all that I have worked to keep a balanced feel to combat with them,
  • Drifters have a slightly higher vertical reach, making the two-block high "nerd poling" tactic, as some call it, obsolete,
  • Some drifters have had an unused animation in their shape file added to them, causing them at times to crawl rapidly toward you (quite creepy coming at you in the dark out of brush and tall grass),
  • Added "Rage Mode" sort of behavior that can be triggered if you tick them off enough (do enough damage),
  • Reduced spawn sizes and greatly reduced spawn chances for top three tier of drifters, but encounters with them are much more memorable,
  • Adjusted loot drops to make more rare and more dangerous higher tier drifters more valuable,
  • Mr1k3's vision and reworking of the way drifters look in his Better Drifters mod (of which this is a branch I've been working on for my server, with permission), has rendered them much larger than their vanilla counterparts and quite terrifying and intimidating to encounter. The only edit I've made is to make corrupt drifters much larger.
  • Lowered light level requirements for all drifters, making it easier to prevent spawning via using light sources,
  • Spawning parameters that make encountering all drifter types likely regardless of your elevation in the world, though corrupt and nightmare drifters are very, very rare anywhere (which is one thing I am hoping to change the deeper you go below ground, which is what the op request here is seeking to address).

This feels like one last element I'm looking for in my vision for how drifters will work in the game world, but it is beyond my abilities to implement, since it requires code work. 😔

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

Hello, im not a code wizard but something i can code too :D.

Here is the codefile. It makes, that only the third part of the drifters, which spawn above the Y-Position 100, really spawn. You can open the file with the normal text-editor or a better programm and change the properties. Its written down there, where you must change.

Dont forget to create a "src" folder next to the assets folder, change your modtype to "code" and change the drifterclass to th class "EntityDrifter".

I've tested the mod out and even if you spawn a drifter with the spawnitem, there is a chance, that he does'nt spawn. In fact, the naturally spawning and the spawning with the item is the same.

I hope i could help you, and sorry for my writing mistakes, im not english :D

Class1.cs

  • Like 2
Link to comment
Share on other sites

10 hours ago, Vintagebob said:

Hello, im not a code wizard but something i can code too :D.

Here is the codefile. It makes, that only the third part of the drifters, which spawn above the Y-Position 100, really spawn. You can open the file with the normal text-editor or a better programm and change the properties. Its written down there, where you must change.

Dont forget to create a "src" folder next to the assets folder, change your modtype to "code" and change the drifterclass to th class "EntityDrifter".

I've tested the mod out and even if you spawn a drifter with the spawnitem, there is a chance, that he does'nt spawn. In fact, the naturally spawning and the spawning with the item is the same.

I hope i could help you, and sorry for my writing mistakes, im not english :D

Class1.cs 1.83 kB · 3 downloads

Thank you for the file!

I'm looking it over and trying to understand what it does, exactly. I don't know .cs code at all. :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.