#Trying to make a codemod to have my custom slugcat get a warmth boost and start glowing
1 messages · Page 2 of 1
okay so you do need the CWT to make it specific to a player
This is what a CWT format looks like.
Requirements:
- A static class to contain the CWT definition
- A non-static class to server as the CWT data class
- The long static methods you see in my screenshot
Instead of ButtonTemplate, you put the class type you want a CWT for
i see
so would i use the lantern class or the lightsource class?
also would the cwt go outside this public class? (its late and im trying my best to understand at the moment
)
You would need one of these for Lantern, or maybe AbstractLantern not sure... if you wanted to implement lantern effect lifetimes.
You want to create one for Player class to make sure the smoke targets the correct player, and the effects apply to the correct player for that matter.
On that last point, it is common for players in coop to share effects. If this is something you want, then you don't have to make it per player
You can make the effect apply to every player
But if you did that, you should check that at least one of those players is your slug\

ill ask more questions in the morning! and try to code it when im not busy
thanks
Askin....
eating dinner but these are the errors i got
@still pecan
@undone flint
(srry for ping)
trying to use shorthand in a inssurported version
you can use = new Type() instead of new()
and the extension method doesnt need to be on generic class (Class<T>)
You need to set your LangVersion for your project to 9 or greater to use that syntax
where is that?
uh huh, but how do i get to it exactly?
do you HAVE the Solution Explorer opened?
yes
what is the name of the file youre in?

is the name
it can be any name
i still hate my ife
Solution Explorer
the FILE Below the the SOLUTION
]]
i cant
but this should work
strange...
assemblyinfo is the same thing
it is??
assemblyinfo is the old way of handling property settings.

okay then.... what do i do now 
worse I've never seen this before so thank you
can you print?
print??
yeah?

if you mean screenshot, then yes
i know nothing about the old way sorry
is same thing for me
screenshot == print
oohh I didn't realize it was going to be a whole different format.
I don't know how to modify that file

but atleast you can just new Thing() instead of new
If you don't wish to do some personal investigation, just don't use newer style C# syntax
about that
Also you should be using normal project files if you are using the latest version of VS.

Don't try to create an instance of a Type
I noticed that you take this literally
I better watch out for what I say 


you can pass the mouse above and see
and just pick this type
I see
It's totally annoying and UNNECESSARY IN C#
I agree with this and will not change my opinion

i mean, the variable
oh
or just copy the type before
and use it
= new ConditionalWeekTable<LightSource, ButtonTemplateCWT>();
i hate that
just for confirm, you did it?
You need to do new ConditionalWeakTable<LightSource, ButtonTemplateCWT>()
also rename the CWT data class to something more relevant please
just for the top?
this has got me so irritated and the fact that its also almost 11 pm isn't helping 😭 
you can't do new Type, you need to specify the class you are constructing
new LightSource or new ButtonTemplateCWT?
LightSource have arguments
so, if you pass your mouse above of the class with the error of arguments, you cna see what is
but why LightSource?
like
you can use the button one
LightSource its from game, so, you can't use that on the new
afai
k
You don't create a new LightSource there
That new() is defining your data class
I hate explaining
And don't call it ButtonTemplate, that's for my CWT
thanks fluffball
you can rename it to whatever you want it to be
new LightSource is still here
I just told you....
one sec
The class you put here is the class that you reference where that new is.

it's optional in c# 11
var is what i am very familiar with
but they would have to figure out how to do that with their project
@undone flint This is in my messages I noticed
best readme
use 'switch' expression
hmmmm i see
dont know why this is freaking out though, i mean i do.. but it was fine earlier 
i really liked this thunder
hmmm
extension method?
extension?
I don't even know that much about this method extension thing
huh
You cannot have extension methods in a non-static class. simple\
but afaik, it adds things to existent things
wha
it got confusing for me
Create a static class for your extension methods
Good
ok, im going to sleep 

Just, don’t commit changes
I don't know everything about github btw
Just, don’t touch any of the GitHub stuff in VS, then you have type out the messages

You can only commit the changes you want to commit
Your git tool will have something similar.
- Select the lines you want to comment
The reset option would reverse the changes made by the selected lines. Be careful with that
You can also choose to stage some files, but not others.
Well you should. you want to have commits that reflect a specific purpose or accomplishment in the code.
If you finish a task, stage all of the changes for that task, and give it a commit name
// says: "I just does not exists"
reset option would probably help with almost nothing other than hindering me
I've suffered this many times before
Commit: Added new medallion sprites to project
Commit: Fix null ref cause by new sprites
but I only update all the content
I only update when there is no null or error
except bugs, they're funny
You should commit more specifically, but you don't have to
stage
reset
comment selections....
......nah
I'm a bit confused as to the context then. Were you not complaining that you had to submit all of the changes at once
kinda useless for my use
was other thing
....nvm then
At least there are new things in git that I've never seen but probably won't touch
thanks
yet
and you're welcome
School started so I can't mod at the moment

Should have started earlier 
uhhh
Remember when you wanted to change the C# version?
well, I discovered it and found it easy
..ah i forgot
(your) school moment see ya
but i will let the step here that i made anyways
- Search your
.csprojfile
- RIght Click and Open it with Notepad
Open With > Notepad
after that, you will need to add it there (yeah, it doesnt add it for you when i saw)
- you wull see this message in VS
just Reload or Ignore if you want
and then, done
now i can make the shorthand version!
NOTE: If you dont see the noetpad option, you need add it
Choose other app
- More Apps
NotePad
done
..sorry for the big tex
oops

gonna take a crack at the CWT again
ok
i think i just need to add the light that's attached to the body
@still pecan i hope you're not busy, if you are, sorry about that (i'm looking at lantern light code at the moment)
what the comment says is a CWT is not a CWT
hm
what are you trying to do?
attach a light source to the main body chunk
this is the last thing i need to do if i remember correctly
I've mostly forgotten about the state of progress for this, and I am pretty busy these days
its alright, we all get busy sometimes
I recall something about you having to specify a parameter to attach the light source to
hmm
i don't exactly remember what i wanted to attach it to
maybe i was talking about the main body chunk?
lol
Oh I think I can help with that
// Pioneer glows by default orig(self); if (self.lightSource != null) { self.lightSource.stayAlive = true; self.lightSource.setPos = new Vector2?(self.player.mainBodyChunk.pos); if (self.lightSource.slatedForDeletetion || self.player.room.Darkness(self.player.mainBodyChunk.pos) == 0f) { self.lightSource = null; } } else if (!self.player.DreamState && self.player.SlugCatClass.value == "Pioneer") { self.lightSource = new LightSource(self.player.mainBodyChunk.pos, false, Color.Lerp(new Color(1f, 1f, 1f), (ModManager.MSC && self.player.SlugCatClass == MoreSlugcatsEnums.SlugcatStatsName.Slugpup) ? self.player.ShortCutColor() : Color.cyan, 0.5f), self.player); self.lightSource.requireUpKeep = true; self.lightSource.setRad = new float?(600f); self.lightSource.setAlpha = new float?(1f); self.player.room.AddObject(self.lightSource); }
this is how I attached a lightsource to my custom slugcat
mess with the numbers and colors & stuff to adapt it to how you want
Woahhh
THANK YOU SO MUCH???
you're welcome!
I dunno, this works for attaching a lightsource
you're gonna have to try it out
oh just so you know, this is in a hook to PlayerGraphicsUpdate
Oh
I gotta find an ss of my timer
I'd open my file again but this is from me scrolling back
Yeah I think the lightsource just has to be activated on and off with the timer
Not sure what to do next, I gotta clean anyway
Oh wait for your slugcat does the lightsource always stay on?
Oh wait nvm
I just read it again don't mind that 
@brisk patrol (sorry for ping) but are you able to help me work this out if you aren't too busy soon? 





