#Reference Enemy with Tutorial/Documentation
1446 messages Β· Page 2 of 2 (latest)
Are you doing what example enemy does? For me it seems to work just fine?
Yea, I think so. I'm going to try once again from the beginning and see if I missed something
I got a slight issue
you can move the mesh higher, but also you can move the height of the navmeshagent
I couldn't on that specific model. But, now I can(Changed it to something different)
okay! One way you could do it is add an empty gameobject at the root of the prefab, which would allow freely moving the mesh. I will add that to example enemy soon, since it would also make modifying the enemy a bit easier.
But for the navmesh position, it's just one value on the navmeshagent component
Oke! Btw what node type did you pick for scan node?
It's uhh, it's just the one that is on Example Enemy, I don't remember what it is or how Zeekerss system works lol
But yeah, I just copied it from other enemies
I'll check it asap
is there a way to lock the player camera to face the enemy?
I think the fiend mod does that somehow but I am not 100% sure
Yeah, Fiend does it(I know 'cause I played with the mod). The masked does it, too, and I believe both of the enemies do it similarly(?)
Btw is this the correct setup in terms of the game object? I always struggle setting up things in Unity while I take no issue coding stuff in VS2022
Weirdly enough, I forgot to remove the light and camera when exporting from blender, that's why there's a mesh in the hierarchy
Yeah, seems fine to me. But really, the important stuff is the components and tags on the gameobjects themselves
I've assigned the tags and layers given in the guide, however, I believe turncompass, eye, and attackarea are untagged, but has the enemy layer. I can't seem to find the rest of the MMHOOK dlls despite having it installled
oh, that means you installed HookGenPatcher manually and didn't copy the config file to the config folder, correct?
Anyways, does the game still run fine?
Yeh, runs fine
if yes, you don't need them, because LethalLib I guess only depends on MMHOOK_Assembly-CSharp.dll
but yeah, these turncompass, eye, and attackarea are not all required, or, well, the "eye" is somewhat, but the rest are not
the eye is used if you want your enemy to require line of sight
which you would do in code, of course
Ye
I just put them in for good measure, in case I want to play around with them further
Oh, I am not using lethallib to implement enemies. I am using the base guide for the set up for enemies
what is the "base guide"?
The setting up enemies part
oh yeah, but the plugin code itself registers the enemy with LethalLib
I got the enemy to work finally. It seems like I did miss a step(not sure which one). Thanks for the guide btw!
Nice! Also, which step do you think you missed? Do you have Netcode Patcher set up in your project?
Yea, I have netcode patcher set up. I believe the issue stemmed from possibly the collision game object itself
I must've forgotten the Enemy AI Collision Detect script, because I took a look into that class, and it referenced the OnCollisionWithPlayer
oh, yeah that one is important
can i rotate my enemy by 90 degrees to the left without having to create an empty parent w/ all the new scripts and references and layers and yadda yadd?
why do you need to do that? Is the rotation of the base model incorrect?
for some reason
the model before was rotated the same in blender but did not have issues
eugh
has this been an issue from the start?
okay, so you'll want to export the model with proper settings for the directions
ive used the ones from the modding wiki
have you tried applying rotation?
in unity yes
in blender though?
rotated the model by 90 degrees but that did nto change anything ingame
no I would have to re apply scripts and components etc
:d
oh, your enemy is not facing in -Y
oh
it is facing in X
oh
yeah, just fix that :3
I honestly don't know, could have been luck lol
ye all good
nice!
do you by any chance know what a HUD object needs in unity?
as in a visual effect, like the masked red visuals or company creatures mushrooms
I believe those are post processing effects, not 100% tho
What affects the ability for an enemy to slow down, like when turning and stuff? I have an enemy that slams into walls when it's moving and tries to turn, and it looks sorta janky like that.
it is navmeshagent stuff, like probably the acceleration if it's named that
do mods generate pdb files for people who downloaded it?
The pdb file is something that is generated when you build your mod, and you can ship it with your mod. In the example enemy project, it is embedded in the assembly so it's always there
I didnt want my file path to be shown in the console whenever an error occurs
but I did not include the pdb in the mod zip, so will people who downloaded my mod generate a new one?
oh my lord now I get why you guys almost never saw him
there was a bug that prevented slenderman from spawning when taking a page after a day where he already spawned
@alpine silo you'll want to look at #1217245173483048970 message
I should add this to LC-ExampleEnemy, but I haven't had the time to do that yet
and no, it is only generated when the mod is built, so it will not be generated afterwards
omg
okay thanks
thank you!!!
are there any known incompatibilities with old enemy AI and items/LethalLib code with v50 yet?
I heard that the enemy registration in LethalLib didn't work due to some change in the game's code, but I think that's about it
okay
LineOfSight function was replaced
lemme check
is there like a collection where I can see all replaced methods etc?
thanks
i think this was the new method
but the parameters are the same?
theres an extra parameter iirc but you should be just able to null it and use it the same way
this has a lot of stuff about changes
thanks
theres like minimal changes to the unity project, i think nomnom made a migration tool if you wanna update your unity project but i'd wait till full v50 release
i havent had to change anything about my shop item, scrap, or enemy
except making my own line of sight function
okay
instead of checking what version im in, making my own line of sight just let me be compatible with v49 and v50
alright yeah I think ill just wait for the official v50 release
I assume most mods are still not updated to v50
or that yeah
quite a few are, i might not be updating mine cuz like, im waiting to port to LLL
LL is unlikely to be supported after this updated
but not sure of lll supports custom enemies
oh alright
aw man idk I am too nooby for that
dw
welp ill wait and see
its practically the same as LL
they both use very similar logi
the only difference is one has extra features and is still maintained
lll does not work with items/enemies spawning on custom modded moons tho afaik
at least lll fixed which I use
because lll made my friends glitch thorugh the interior floor
LLL doesnt have custom items and enemies yet
and made them have different interiors than I did on the same moon lol
itll be next update
ah
Oh boi can we get some pins in here? π
Sure but what questions u got?
Im pretty early in development with my custom entity and my head is full of questions. So Imma for sure read through all of this π but havin pins for crucial stuff on this would be nice to have π«£
Lethal.wiki would be much more helpful
It has everything that you need to know
Including stuff from here lol
Is there anything about textures / shader in there?
There isn't anything about textures / shaders here
Textures are pretty simple lol
Shaders... maybe, I havent learned em yet tho
Well im still just makin the model and itβll take quite long til im workin on textures / shaders. Im just thinkin ahead π
Generally the process for creating my enemies is the following.
Make a model in blender
Texture it
Rig it, fix its weight's
Clone the example-enemy project into your own github, rename stuff for your own project, rename the modasset into whatever asset bundle name you want
Import stuff into Unity, make sure you're using the right asset bundle name
Apply the basic gameobjects and components you need for a basic enemy.
Then start making the AI etc
Holy fuck
Um let me see if I can find you a tutorial
This is absolutely horrid
And it WILL fuck you over later
And by later, I mean quite immediately, halfway through making your enemy AND after you're done making your enemy
I linked this one in my readme already but here.
https://youtu.be/AlPPYkZg9D4?si=ijeyMjsbdtsfbSYn
I picked the model of bracken for a base and made changes on it - for example turning tris into quads
Yeah i pulled my hair workin with it already
It is MUCH easier to actually learn how to make the model
Takes probably 5 minutes to do what you're making with skin modifier
So i should instead work from scratch with a 2d art behind it for reference and work my way up from there?
Yes
That tutorial taught me a lot about different tools etc
References are extremely helpful
Aight imma ask for someone to make a sketch about my guy cuz im not good in that π
can really recommend pureref for that
you can just drag&drop any google image you want to use as a reference onto the canvas
Hey all, i'm trying to make my first mod which is a enemy mod. I'm new to modding so it may be a noob question but after i drag and drop my enemyType prefab and animator into the asset bundler and build it. I run the game and the game fails to see the enemyType and i have no idea why its happening ? Anyone had this issue before π
Doing Logger.LogInfo(bundle.GetAllAssetNames()); in the code also returns System.string[] sooo it just doesnt seem to recognise anything in the asset bundle?
Ive never heard about dragging&dropping stuff into an asset bundle
I did it with the button on the bottom right of the interface
there I could select an asset bundle
It was me being stupid, i input the wrong asset name into the code whoopse
Happens lol
is there a known release date for v50 yet?
I dont really wanna update my monster mod only to rewrite the code a few days/weeks later in case of new v50 code changes
As far as I know the only thing changing for the EnemyAI abstract class is the line of sight function being renamed/replaced
thats really all that has been changed?
welp in that case
I might make a custom method for both v49 and v50 as well
although if my enemy dependns on ll Ill probably have to wait for an official ll update for v50 anyways
LL works for v50 now, for a few days already
Hey guys, once again a stupid question probably. I got a enemy mod and my code seems to work. The only thing that doesnt is the enemy killing the player on contact and the enemy opening doors. OpenDoorSpeedMultiplier which is set to 1 but it doesnt appear to do anything. The killing code i have is the following: ```public override void OnCollideWithPlayer(Collider other)
{
PlayerControllerB playerControllerB = MeetsStandardPlayerCollisionConditions(other);
if (playerControllerB != null)
{
Debug.Log("WidePutin Collision with Player!");
playerControllerB.DamagePlayer(100);
}
}```
do you have an enemy AI collision script on your collider?
Yea, i was not entirely sure what to add to the main script so i added the prefab to it which should be fine i suppose
try setting this Door Speed Multiplier also to 1 and see if that does anything
something like this?
did you make sure IsTrigger is on?
also try to put debug messges in your collision stuff to make sure the code is running in the first place
but yeah isTrigger should be enabled
yea all is set, except the can collide with enemies
you dont need that part for what you're trying to do
is it that your rigid body is setup like htat?
try turning off gravity and turning on kinematics
rigid body settings can be a little confusing so i dont understand it 10%
100%*
Oh yea that could work, i'll try that π thanks guys
That solved both issues π
nicee
my enemy is visible through any fog, even when far away
is there a way to change that?
as in, the further away it is in the fog from the player's view, the harder it is for the player to spot it
Did you miss with your enemy's emissive map?
Yeah but when you were applying the texture in Unity onto a material, you put the texture onto a base map, did you also put it into like an emissive map
I dont think so
Can you show an example of the problem?
I believe the way vanilla combats this is by changing the mesh based on how far away the player is
I'm not 100% sure how they do it though
I just noticed the forest giant has a close and a far bosy
Body
I think its called LOD, but I havnet got a clue apart from that
one sec
I always thought it was normal like that for lc enemies but someone mentioned it in my mods channel a few days ago
I think they mean this
that the enemy kind of stings out/has such high contrast even though there's fog
do I need to re import the dlls for v50?
Which dlls?
assembly csharp
The assembly csharp? Yes
oh
and lethalli?
b
I suppose its not enough to change the one line of sight method to the new one to properly update my mod
i forgor how to import them/add them to dependencies since my visual studio hates me and doesnt show up the proper windows for that
I'll do that another day, thanks for the information though!
Your csproj to update the version number, dll folder to put them in
All good
Example Enemy should be updated with v50 unity project too
oh do I need to make unity changes as well?
Kinda? You'll want your Unity to be latest version
I meant like
Do I need to re export the asset bundle or change stuff with the unity objects
i made 0 changes to the actual project in unity
Okay
If my enemy used the new los method though I probably have to update the mod dll in the unity project thiugh
Eh
Not sure rn I'll check that later
its weird, I have checked that v50 is installed but ILSpy still says in playerControllerB that the LOS method still is the old one
but it should be in Assembly-CSharp.dll -> GameNetcodeStuff -> PlayerControllerB right?
Its the enemy los method that changed, not tbe playercontrollerb one (im 80% sure)
Yeah
But the enemy method still looks the same on the player Controller class
For some reason
Btw, I'm finally working on an update to LC-ExampleEnemy to make it easier to update it and projects based on it, when the game updates :3
And this is of course done by referencing the game's assemblies directly instead of copying them in a folder called dlls. Though still updating the Unity project won't be as easy, but anyways the way how this worked before was horrible π

And I'm doing this by basically basing it on Xilo's template projects
though, it will not be a template in the same way as Xilo's templates, I'm too lazy for that
thank you for your work brother π€©
Okay, done! And I hope I didn't break anything :3
the method is a part of the playercontrollerb class I think?
honestly I'm just really grateful that you made the effort of creating this template in general
without it I'm sure there wouldn't be as many enemy and item mods as there currently are
thanks! :3
HasLineOfSight was replaced for CheckLineOfSightForPosition in the enemy ai class. For the playercontrollerb class i dont think anything was changed (to do with line of sight thingies anyway)
yeah my code didnt use the enemyAI method after all
just the playerControllerB bool
do I need to check the destroy on death box?
Nah dont
actually it depends. What it does is just completely remove ur enemy from the game the moment it dies, which will cancel out any death animation/sound etc
hmm
welp I think it has worked fine so far so ill just keep it how it is
Fair enoigh
I patched it with the new dlls now though and updated the assembly csharp dependency, so I assume errors can now occur with v49?
Im not sure tbh
currently trying to add a config for my mod where you can select custom moons with a custom weight each for the spawnrate of an item, like so many interior/enemy/item mods use the format "Moon:Weight;Moon2:Weight2", but I have no clue on how to do that
is there any guide for that?
yea i tried to do that too with enemies in lethal lib but idk it just doesnt work for me, im prob doing it wrong
i think hamnuii and xu know
(and @alpine silo ) This is done with dictionaries, there is an example now on LC-ExampleEnemy Plugin.cs, and also TheGiantSpecimens has a system where you can input the stuff in a config and then it uses that to add enemies to specified levels with their rarities
Anyways the dictionary stuff in LethalLib rused to be broken, until I fixed it
I've had to remove the way I do it in my mod since I've moved onto LLL, but I'd be happy to help you port
Thanks
ty
in the custom rarities dictionary, would anything bad happen I set the rarity in infernis to be 69 or whatever, but then I run the game without actually having the infernis mod installed?
nothing bad should happen no
i also wrote a lil config parser if you want
it takes a string like "Infernis@400,Junic@200,Egypt@50" and makes the dictionaries for both vanilla and custom moons
oo yes pls π
private (Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) ConfigParsing(string configMoonRarity) {
Dictionary<LevelTypes, int> spawnRateByLevelType = new Dictionary<LevelTypes, int>();
Dictionary<string, int> spawnRateByCustomLevelType = new Dictionary<string, int>();
foreach (string entry in configMoonRarity.Split(',').Select(s => s.Trim())) {
string[] entryParts = entry.Split('@');
if (entryParts.Length != 2)
{
continue;
}
string name = entryParts[0];
int spawnrate;
if (!int.TryParse(entryParts[1], out spawnrate))
{
continue;
}
if (System.Enum.TryParse<LevelTypes>(name, true, out LevelTypes levelType))
{
spawnRateByLevelType[levelType] = spawnrate;
Plugin.Logger.LogInfo($"Registered spawn rate for level type {levelType} to {spawnrate}");
}
else
{
spawnRateByCustomLevelType[name] = spawnrate;
Plugin.Logger.LogInfo($"Registered spawn rate for custom level type {name} to {spawnrate}");
}
}
return (spawnRateByLevelType, spawnRateByCustomLevelType);
}
now its nothing pretty
and this only works for LL
but yeah
ty
ignore that im using it for just scrap in this example
but this is how you would use it
where configMoonRarity is the config's string
ty, ima slap it onto my ghost lol
private void RegisterEnemyWithConfig(bool enabled, string configMoonRarity, EnemyType enemy, TerminalNode terminalNode, TerminalKeyword terminalKeyword) {
if (enabled) {
(Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) = ConfigParsing(configMoonRarity);
RegisterEnemy(enemy, spawnRateByLevelType, spawnRateByCustomLevelType, terminalNode, terminalKeyword);
return;
} else {
RegisterEnemy(enemy, 0, LevelTypes.All, terminalNode, terminalKeyword);
return;
}
``` i also had this function to make t hings just a tiny bit easier for me lmao cuz im lazy
thank you, Ill test that out with my mod
thanks
I think I am missing something
is there some sort of conflict or competition between ll and lll?
I thought lll only supports moons
LLL supports interiors, moons, enemies, scraps, items
I have seen many people say they switched to lll
i think so
okay
are there many differences between ll and lll?
I might break my mod trying to port :p
nah porting from LL to LLL is pretty easy
they both use similar systems cuz vanilla systems
is there a guide on how to port?
sorry I just wanna avoid utterly destroying the mod :p
I'll make one tmrw or today, im just busy with rewriting locker's AI rn
nah thats reasonable lol
im not maintain LLL lmfao
im maintaing giant specimens, helping out with locker since guy is busy
mad respect I love enemy mods
making viral company, code: rebirth, maintaining immersive scrap, already finished with hotbarrd
not sure what im missing but im probably missing something
im looking for people to help me make code:rebirth rn since it'll be a much bigger mod lol
ye, im also making tutorials on enemies, scrap, items and writing notes for when i make the LLL lethal wiki docs
oh I probably won't be able to help much sorry, my modding knowledge is still
pretty bad yeah
thats completely fine tbh, you've managed to make something which is already good enough :3
thanks for the commitment, I really appreciate that
wouldnt have been able to make slenderman without the guides!
the guide you followed probably didnt have my changes back then xd, but you're welcome :3
anyway imma probably afk for a bit, this locker code doesnt look the greatest π
ty
idk if im doing something wrong cuz the custom stuff jus doesn't work. The console does say that the ghost was registered in the levels but it jus isnt: [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for custom level type Experimentation to 999 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for custom level type Titan to 999 and then when I go to titan this is the spawning log thingy:
[Info : Unity Log] enemy #0 probability - 16
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Lasso
[Info : Unity Log] enemy #1 probability - 0
[Info : Unity Log] Enemy 1 could not be spawned. current power count is 0; max is 18.
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Bunker Spider
[Info : Unity Log] enemy #2 probability - 59
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Centipede
[Info : Unity Log] enemy #3 probability - 54
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Blob
[Info : Unity Log] enemy #4 probability - 19
[Info : Unity Log] enemy #5 probability - 62
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Spring
[Info : Unity Log] enemy #6 probability - 59
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Crawler
[Info : Unity Log] enemy #7 probability - 53
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Hoarding bug
[Info : Unity Log] enemy #8 probability - 38
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Jester
[Info : Unity Log] enemy #9 probability - 62
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Puffer
[Info : Unity Log] enemy #10 probability - 16
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Nutcracker
[Info : Unity Log] enemy #11 probability - 71
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Masked
[Info : Unity Log] enemy #12 probability - 31
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Dalek
[Info : Unity Log] enemy #13 probability - 0
[Info : Unity Log] Setting enemy numberspawned to 0 to start: VileVendingMachine
[Info : Unity Log] enemy #14 probability - 20
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Butler
[Info : Unity Log] enemy #15 probability - 0
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Butler Bees
[Info : Unity Log] enemy #16 probability - 0
[Info : Unity Log] Setting enemy numberspawned to 0 to start: Red pill
[Info : Unity Log] enemy #17 probability - 0
[Info : Unity Log] Enemy 17 could not be spawned. current power count is 0; max is 18.
[Info : Unity Log] ADDING ENEMY #3: Centipede
[Info : Unity Log] Adding 1 to power level, enemy: Centipede```
I use the register thing: RegisterEnemyWithConfig(true, "Experimentation@999,Titan@999", _harpGhostEnemyType, harpGhostTerminalNode, harpGhostTerminalKeyword);
Do ExperimentationLevel
I forgot to mention
oh lol
true
It'll be fine for custom levels and artifice and adamance and embeion
Embrion*
Since they're not technically vanilla in LL
afaik I wrote the code to allow also not having the "level" part be there, for compatibility with LE
Not for vanilla
Learned the annoying way where my mod didn't work for a couple days
For debugging LL, set extended logging to true so you see where stuff gets added to
Cuz nobody realised my enemy not spawning was a mistake lol
why would it break with vanilla but not custom moons?
or is vanilla "LL knows this moon exists in vanilla"?
Vanilla prolly matches the enum
It might just be the way I parse the function actually, but then it'd recognise Experimentation as custom
:3 yeah probably on my side but tbf it's a stupid problem
I'm not sure actually
hmm, dunno
I've been very absent from LC modding. What did Zeekerss change in terms of enemies?
HitID in HitEnemy and one line of sight function got changed
Oke, thanks!
LMAO I'm stuck on the first step, what package do I need to install for contextlib
Aren't you supposed to do python SETUP-PROJECT.py
same error
its importing before line 6
Is it the fact that yoy changed the folders name?
Try doing it before you do stuff like editing the name of the folders etc
I didnt change anything, its straight extracted from github.
I now tried to modify the code to import the entire contextlib, and now it kinda runs, but crashes on "chdir", it seems can't reference contextlib.chdir
im running 3.10 btw
this is after I imported the entire contextlib
@merry crow you could try installing the latest python version, and if nothing works, you can manually do the steps instead (steps are explained in README.md)
okay okay thank you! I didn't notice there are written parts for manual setup, I was about to read the code to see what file it's trying to copy and figure it out that way but got sidetracked hahaha
Intellisense says "private (Dictionary<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType)" is invalid
I have put both this and the ConfigParsing part in my Awake method
uhh these are methods, you wouldn't put em in awake
you'd use em in awake, but not put em in awake
this is what you'd put in awake
oo nvm stupid me put the method outside of the class
seems to work just fine now, thank you!!
Sry for ping, I've tried doing this too but it still didnt work. I tried titan and adamance several times and the ghost doesn't get mentioned in the the spawning logs. The code to register them did work though: [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type Modded to 100 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type ExperimentationLevel to 50 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type AssuranceLevel to 100 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type VowLevel to 200 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type OffenseLevel to 100 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type MarchLevel to 200 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type RendLevel to 200 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type DineLevel to 100 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for level type TitanLevel to 999 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for custom level type Adamance to 100 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for custom level type Embrion to 150 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for custom level type Artifice to 200 [Debug :LCM_HauntedHarpist|1.3.12] Registered spawn rate for custom level type Auralis to 150
can i see your spawning logs and what u do to get em? cuz this looks like it works for me 
hmm not sure why it doesnt show, it works for me, can you try seeing the spawn weight by adding code that outputs your enemy's spawn weight when u manually spawn it in and spawn it in on adamance or titan?
thats how i check
ye sure, gimme a sec
wait how lol
ty
does anyone know the purpose of the variable public float mostOptimalDistance in the EnemyAI class? From what I can see is that its used in a few methods, but before its used he resets it to some big value, which ultimately defeats the point of it being a class variable and not a local one?
yeah I dunno really about zeekerss code lol
oh ok, just checking im not going insane lol
Btw for anyone interested, I'm currently working on a branch of LC-ExampleEnemy which can be live reloaded so you don't need to restart the game to see your changes
I got it already working somewhat, but I had to disable networking functionality, which is fine for solo testing, but otherwise looks promising
this is of course using BepInEx.Debug ScriptEngine
oo that looks cool
do you think u would able to do it with networking functionality in the future? Or is that impossible lol
It's definitely possible, but I don't know enough about Unity NGO to know what to do. It's possible that all I'd need to do is remove the enemy prefab from being a registered network prefabs list.
However, the current way live reloading works isn't really optimal since you can't attach custom scripts in unity because they lose their references due to how Script Engine works, and the enemy prefab must be deleted and readded every time the plugin is reloaded, so I might come up with a solution that fixes these issues.
And that solution would be to instead of reloading the whole assembly, we just detour from the original methods to the methods in the new reloaded assembly (so we still reload the assembly, but we keep the old assembly there so anything that needs it has it and will be rerouted to our new assembly). Then scripts in asset bundles will get their references, and we don't need to completely clean up everything we did (like destroying our old enemy gameobjects)
So, that's gonna be the next project I'll probably do, which is a fork of Script Engine that does that detouring stuff
Since reloading plugins is super useful, but Script Engine definitely has issues, like I had to combine two assemblies into one as it can't really handle hot reloading dependencies
oh ok fair enough
