#⌨coders-cave

1 messages · Page 46 of 1

main brook
#

i can just work at a minimarket

#

with minimal wage

#

but nah

wet girder
#

U have easy situation as I'm 15 but I get money from summer jobs and my parents have decent wagr and all

main brook
#

strict rules about age

main brook
#

im asking like

#

$8

#

in the terms of 1 year

#

just for earphone

#

that's broken in a few days

barren shale
#

Well, if your parents are having a hard time, you probably should do a part time job because they wont buy you anything

main brook
#

ik

#

but no shit

#

they just

#

"you need to study"

#

no can't work

#

my brother is in university but doesn't have a part time job

barren shale
#

Online school but no pc

#

How

main brook
#

phone

#

exists

barren shale
#

Tell them it makes your eyes hurt

#

LIE

main brook
#

they will just

#

add reasons

#

"but not if you're playing game"

#

also yes no lie

barren shale
#

stop using your phone for a week

main brook
#

phone exists

main brook
#

since i had some

#

break

barren shale
#

If they asj you why

main brook
#

i can finally let go of my phone

barren shale
#

Your eyes hurt

#

Gib pc now

main brook
#

;-;

#

the frixk

#

how would that work

barren shale
#

It will

main brook
#

reverse psychology??

barren shale
#

Trust me

#

Big screen are easier on the eyes

main brook
#

not me

#

i find myself native mobile user

#

when i use pc my performance declined

barren shale
#

Coding on mobile

main brook
#

by roughly 30%

barren shale
#

Not the best thing

main brook
#

i knew that

#

BUT ATLEAST I CAN MAKE SOME SHITTY THINGS

wet girder
#

phone screens hurt my eyes so fuckin much

barren shale
#

Yea phone screens are much harsher on the eyes

main brook
#

for u yes not for me

barren shale
#

Rhe text so small u have to focus so much

main brook
#

not me

barren shale
#

Youre probably used to it that you wont feel it

main brook
#

im young

barren shale
#

Jupe said he is 15

wet girder
#

only reason my dad gave me permiu to buy this good pc with 400€ is because I said it'll make coding easier lol

#

I'm 15 lol

barren shale
#

Rei

#

Trust me

#

Do what i told u

main brook
#

and im 14 and puberty hits me like a truck

main brook
barren shale
#

If they said they can't afford it

main brook
#

DUDR

barren shale
#

Twll them you'll work

main brook
#

MY FAMILY IS HAVING FINANCIAL CRISIS

#

like literally

barren shale
#

Yes that's why you will part time

#

One month

main brook
#

my mom wage can only make us through 3 weeks and a few days

barren shale
#

U have yourself a pc

main brook
#

do u know that

#

part timer gain like

#

a few dollars

#

THAT'S PER MONTH

barren shale
#

U said minimum wage

wet girder
#

I bought my first setup with 12€

main brook
#

yes and guess what

#

pc cost like

#

$200

#

and minimal wage are

wet girder
#

yoy don't need that much

main brook
#

10-100

#

per month

wet girder
#

tou could easily get pc with that

barren shale
#

Raspberry pi

main brook
#

my mom makes $360/mo

main brook
#

since its like

#

$6

wet girder
#

older yeah

barren shale
#

Its like 40$ for the best version

main brook
barren shale
#

With alot of ram

main brook
#

no need

#

just smol boi

north dune
main brook
#

no

wet girder
#

Uhh one euro is like 1.3 USD or something

main brook
#

i live in indonesia

barren shale
#

Oh

#

Makes since

main brook
#

but i can translate usd to my native currency easier

main brook
#

holy cow

#

there's no way

#

the only pc that cost like

#

less than 100 dollars

north dune
#

what the fuck

main brook
#

are either super old

#

or broken

main brook
#

ikr

#

our economy are great

barren shale
#

Lol

#

Where i live its about 3$ a month

#

Yes

#

A month

north dune
#

i thought 10-100 a month for minimum wage was bogus

#

im just a dumb murican

keen shell
#

Wtf 1 indonesia is 0,00 euro

main brook
main brook
#

1000

keen shell
#

Oh lmao

main brook
#

the smallest currency we have is like

#

100

barren shale
#

Better than 4000

wet girder
# main brook the only pc that cost like

my school sold old pc hardware like from 2007 and I got PC without hard drive for 2€ because I know the it guy in my school. Then I got hard drive with 10€ and got monitor for free, keyboard for free and mouse for free

barren shale
#

xD

wet girder
#

I used it for a year

#

still good as new

main brook
#

they told us

#

about hardware

#

without actually seeing it

#

and about microsoft paint

wet girder
#

there are some scrap computers somewhere most likely

main brook
#

and even made mistakes about

#

ctrl+a to undo

#

and mock me for being wrong

#

and the teacher said

#

its ctrl+z

#

AND SO I LAUGHED AT THEM

#

hahahhaa

main brook
#

they cost <$100

wet girder
#

Scrap PC's are amazing tho

main brook
#

not really

#

some have broken screen

#

a faulty hardware

#

or a virus installed

#

ehem

#

Hello your computer has virus

wet girder
#

Viruses can easily be deleted and that other stuff is why I love scrap PC's

#

my current pc is made out of server parts from 2012-2018

main brook
#

;-;

#

wew

#

that reminds me

#

i still have 80gb harddisk

#

and 2gb ddr3 ram

barren shale
#

Lol

main brook
#

or was it ddr2

barren shale
#

Probably ddr2

main brook
#

it have a purple color

#

and a ship image

#

on it

wet girder
#

I have 16 gigs of ddr2 laying around

main brook
#

nice

barren shale
#

Here working around 10 hours a day makes you 35$ a month

#

On average

#

Not the best economy

wet girder
#

minimum wage here is 6€/hour

barren shale
#

Here its 3$ a month

wet girder
#

wtf

#

how is anyone supposed to live with that

barren shale
#

Barely living

#

Things are cheaper here

#

Its still a bad wage

main brook
#

you can't die if you never live

#

so barely living

#

I can buy instant noodles

#

and feed myself for a few days with $3/mo

barren shale
#

They probably cant afford instant noodles

#

They mostly buy bread

main brook
#

instant noodles are less than 50 cent

wet girder
#

instant noodles are like 1€ a pack here

main brook
#

bread are more expensive

barren shale
#

From what ive heard

#

Not here

main brook
#

welp rip economy

barren shale
#

Economy is rip a long time ago

#

xd

main brook
#

welp

wet girder
#

It's just sad for me to thibk people have to live like that when I own like 800€ worth of stuff I wouldn't actually need

main brook
#

nice

barren shale
#

I mean thankfully i dont live like that

#

We are considered rich

#

I guess

#

Even though my dad makes like 700$ a month

keen shell
#

You'll never get minimum wage tho, always higher like x1.5 or something

barren shale
#

Here you will barely get minimum wage if ur lucky

keen shell
#

Huh?

barren shale
#

Its oretty fucked up

keen shell
#

Do you mean you get lower?

barren shale
#

Sometimes you dont get fully paid

#

Atleast from what i heard

keen shell
#

Woah that's really fucked up

barren shale
#

Yes it is

keen shell
#

I got 10euros for delivering papers every Thursday

#

40 a month

barren shale
#

Most good teachers rather tutor or go to private schools because government schools pay like 10$ a month

keen shell
#

Took about 2 hours to do with my mom folding the papers

#

The paper eventually stopped lol so now I'm jobless

barren shale
#

My dad's friends, the best math teacher ive known, never taught in a school

#

Always tutoring

keen shell
#

Interesting

barren shale
#

His friend

#

Never tqught in a public school

#

Tutorinf or private school

#

And they are living a good life

#

Teachers that are not as good cant tutor and they wont be accpted in private schools

#

So they live on 10$ a month

#

And work another job to cover the rest

#

When i was in highschool

#

The principal of the school

#

Worked as a barber after school

keen shell
#

ahahah awesome

barren shale
#

If ur late to school

#

Or you have long hair

keen shell
#

Lmao

barren shale
#

He'd give you a free haircut

#

The fuck your hair type of haircut

knotty root
#

Damn

green nexus
#

im not a coder

barren shale
#

Then leave

north dune
#

or learn

#

hamza aggressive

#

CODE OR BEGONE

barren shale
#

Begone none coder or we shall burn you like a witch

fiery egret
#

"Non-coders shan't deceive us, we shall greet their cheeks with grievance."

#

"We will seek each unheeding heathen, see them bleed or plead allegiance." Idk where I'm going with this

subtle bison
empty jacinth
#

Someone delete this

weak holly
#

how did

orchid latch
#

Weird

#

I can see this place

near token
#

Hey guys, is it just me or new units don't attack units from other races anymore?

north dune
#

part of my 3d mod "thickens" sprites by instantiating the original spriteRenderer a number of times and setting the position

but if i delete those instantiated sprites, shadows are left over even though i dont copy those directly

is instantiate copying more than just the spriteRenderer object? i dont use instantiate enough to know whats going on

#

code in case it helps

#

i only directly copy the building sprite so why do i get shadows as well

knotty root
#

the shadows are part of the spritebre

north dune
#

they are a different spriteRenderer altogether

#

or were before this update, think they changed a bit

#

but somehow copying one copies both

barren shale
#

Then they are the same spriterenderer

#

Its just saved in two different properties

#

You can compare the hashes if you want to make sure

orchid frigate
barren shale
#

And btw why do you have the loop twice

#

Seems like the same loop

#

Hmmm

#

So if you instantiate the building you get the shado too

#

What about i instantiating the shadow

north dune
#

i thicken sprites with the original being in the center

north dune
north dune
barren shale
#

A spriterenderer is an object

#

You can save it in two different property

#

Do a test

#

Print both hashes to a console

#

And check if theyre the same

#

Oh wait

#

This is unity

#

Then it all make since

#

The building object is a parent object with the shadow as a child

#

You need to remove the child

north dune
#

but

#

im not copying the building

barren shale
#

Just rhw spritw

#

Yea

#

Wtf

north dune
#

im copying a seperate child, the building's sprite

barren shale
#

My brain hurts now

north dune
#

right?? lmao

barren shale
#

Why is this happening

north dune
#

it seems super strange, there has to be something im missing

#

like maybe instantiate copies the parent as well?

#

but that doesnt seem right

barren shale
#

Maybe they apply shadows to all the sprites in game

#

With a shader

#

Ok

#

Try this

north dune
#

this is how building shadows are created

#

the actual building sprite is created before this

#

during the building creation i think

barren shale
#

But you dont want to make buildings

#

That would bug the game

north dune
#

right

barren shale
#

You just want to make sprites

north dune
#

and so far i think im not copying buildings

#

just somehow multiple components of them from one specific

barren shale
#

Try instantiating a gameobject and add a spriterenderer to it

#

And then copy the sprite

north dune
#

so creating an empty object

#

okay nice

barren shale
#

Yea

#

Create qn empty object then add a spriterenderer component and copy the sprite there

north dune
#

hmm

solemn sigil
#

hmm

barren shale
#

Hmmm

north dune
#

after i add the component, how do i edit it immediately after lmao

#

the object wont have that component in its list

#

i feel like an idiot rn

barren shale
#

The addcomponent returns a reference to the component

#

Send a picture

#

Lemme see

north dune
#

ohhhh

#

i understand then

#

ill want to add something like SpriteRenderer clonedSpriteRenderer = newSpriteObject.AddComponent<SpriteRenderer>();

#

and edit that

solemn sigil
#

Do it

barren shale
#

Yes

north dune
#

got it, will finish and test

barren shale
#

But it might be laggy

solemn sigil
#

Eetswa

barren shale
#

Cuz addcomponent is expensive

#

Did ue computer blow up

north dune
#

loading to test now

#

errored, didnt work at all lol

solemn sigil
#

Eshay

north dune
#

but errored once and continued button presses do nothing

#

so i dont think its doing anything at all

#

not reproducing error, not working

#

this is new code im at

barren shale
#

Lol

north dune
#

these sprites dont show up at all

barren shale
#

You dont move the spriterenderer

#

You move the object

#

And make the list a list of objecta

north dune
#

i move the renderer in current version already

barren shale
#

You have to move the ibjwct

north dune
#

unedited version that works but produces shadows

barren shale
#

Yea i know

ivory orchid
#

#orange_eats_babies

solemn sigil
#

#orange_eats_babies

barren shale
#

Idk how it worked

#

You use the list to delete them right ?

north dune
#

right

barren shale
#

Then you have to make it a list of gameobjectw

#

Because if u delete only the spriterenderer

#

You will have alot of empty objectw

north dune
#

i mean

solemn sigil
#

mean

north dune
#

i have to make these objects work before i worry about cleaning them properly

barren shale
#

Just do as i said

#

Move the object

#

And test it

north dune
#

what the fuck

#

have you made me do

#

lmfao

barren shale
#

Wait

hoary hound
barren shale
#

Do trees count as buildings

north dune
#

yes, so this is creating and attaching sprites to new objects based on those trees

#

but theyre fucking massive and dont count as buildings so 3d isnt rotating them

#

progress tho

barren shale
#

They count as buildings or not

#

I dont get it

north dune
#

trees count as buildings

the ones you see in that screenshot that are bugged are not buildings, theyre GameObjects with spriteRenderer components only

barren shale
#

Yes i know

#

These are the ones we made

#

You probably need to scale them right

#

Try scaling them to 0.1

#

Btw you should probably not delete them and reinstaniate them evertime

#

That might cause lagg

north dune
#

this is not working

#

its got the same bug the lineRenderers i used before has

#

ignoring the scale, these clones look good from this angle right

#

but any time the world is rendered, those new renders are stuck behind it

barren shale
#

What are you trying to accomplish with your mod

north dune
#

this particular feature or the whole thing

barren shale
#

Xd

#

So youre rotating everything to make the game feels 3D

#

You probably need to rotate the copied trees too

north dune
solemn sigil
#

Do you still live in a shed

north dune
#

but then the feature being worked on right at the moment is for taking one of those paper feeling buildings

#

and thickening it
copying its sprite and cloning it several times, putting it right beside the original

#

can see the thickened effect versus what it normally looks like

barren shale
#

Yea

north dune
#

and this works perfectly as i intend, until deletion when shadows are somehow left

#

when i didnt clone them in the first place

barren shale
#

How is it going ?

#

Did u get it to work

fierce epoch
#

hey hamza

barren shale
#

Hi

fierce epoch
#

since maxim gave me a challenge i do something else than the 2d thing

#

i do a tic tac toe

#

but i got a weird error and i can't figure out how to get rid of it

barren shale
#

Send it

#

Lets see it

fierce epoch
#

in a file called

#

Main.cs

#

i have this

#
    void Awake()
    {
        _board.Build(this);
    }

#

the content of the awake function is line number 15

#

error ```NullReferenceException: Object reference not set to an instance of an object
Main.Awake () (at Assets/Scripts/Main.cs:15)

#

but

#

this is actually refering to the class

#

so i don't understand how i get this error

barren shale
#

Hmmm

#

Try using start instead of awake

#

Put _board.Build(this); in start

fierce epoch
#

i still got the error

barren shale
#

Send the error again

fierce epoch
#

NullReferenceException: Object reference not set to an instance of an object
Main.Start () (at Assets/Scripts/Main.cs:15)

barren shale
#

Ok

#

_board is null

#

You need to set it

#

Before you can use it

fierce epoch
#

i did it

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Main : MonoBehaviour
{
    public Board _board;

    private bool _XTurn = true;
    private int _TurnCount = 0;


    void Start()
    {
        _board.Build(this);
    }

    public void Switch()
    {
        _TurnCount++;

        _XTurn = !_XTurn;
    }

    public string GetTurnCharacter()
    {
        if(_XTurn)
        {
            return "X";
        }
        else
        {
            return "O";
        }
    }
}

#

and my Board is :

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Board : MonoBehaviour
{

    public GameObject _cellPrefab;

    private Cell[] _cells = new Cell[9];


    public void Build(Main main)
    {
        for(int i = 0; i <= 8; i++)
        {
            GameObject newCell = Instantiate(_cellPrefab, transform);

            _cells[i] = newCell.GetComponent<Cell>();
            _cells[i]._main = main;
        }
    }
}

barren shale
#

Ok

#

Before _board.build(this)

#

You need _board = new Board()

fierce epoch
#

why

barren shale
#

You know python right ?

fierce epoch
#

yes

barren shale
#

Lets say i have a class named Boo

fierce epoch
#

yes

barren shale
#

I want to make an object with that class

#

I do obj = Boo()

fierce epoch
#

jest

barren shale
#

Here its the same

#

You want to make an object

#

You do Boo obj = new Boo();

#

The syntax is different

#

But its the same

fierce epoch
#

You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all

barren shale
#

Ok

#

Board is a monobehavior

fierce epoch
#

so i guess i use AddComponent now

barren shale
#

No

#

Just add it

#

In the inspector

fierce epoch
#

wdym

barren shale
#

Drag the script to your object in the inspector

#

Just like you added the main script

fierce epoch
#

i never put the main anywhere

#

just the Cell.cs

barren shale
#

Show me all the objects in your hierarchy

#

Send a picture

fierce epoch
barren shale
#

What is the PR_Board

#

Its the board ?

fierce epoch
#

yes

barren shale
#

And its supposed ro have 9 cells

fierce epoch
#

with a grid layout group

barren shale
#

So the board.cs should be on PR_board

#

Is it there ?

fierce epoch
#

ok wait

#

let me send you everything

barren shale
#

Ok its rhere

#

So now

#

In your main.cs

fierce epoch
#

PR_Cell

barren shale
#

Its ok

#

I got it

#

Go to your main.cs

fierce epoch
#

yes

barren shale
#

Make a public field called Board

#

And make _board private

fierce epoch
barren shale
#

Public Gamobject Board

fierce epoch
#

ok done

barren shale
#

Private Board _board

fierce epoch
#

this is what you mean ?

barren shale
#

Ok

#

Good

#

Now what object has the main.cs

fierce epoch
#

nothing i think

#

the board has the borad

#

and the cell has the cell

barren shale
#

Then how are you getting the error if main.cs is not executing

fierce epoch
#

cuz the main is called by the cell

barren shale
#

Send cell.cs

fierce epoch
#

i think

barren shale
#

Are you following a tutorial

fierce epoch
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Cell : MonoBehaviour
{
    public Text _label;
    public Button _button;
    public Main _main;

    public void Fill()
    {
        _button.interactable = false;

        _label.text = _main.GetTurnCharacter();

        _main.Switch();
    }
}

barren shale
#

??

fierce epoch
#

cuz it's useless for me to just follow a tutorial

#

i also have a very bad memory

barren shale
#

This is a bad tutorial xD

fierce epoch
#

so remember where i put what is hard

#

lol

barren shale
#

Tic tac toe

#

Has nothing to do with unity

#

So unity should be used as an interface

#

Idk why this guy is using monobehavior scripts

fierce epoch
#

maxim told me to do one so i can learn basic stuff lol

barren shale
#

Ol

#

K

#

I suggest you start over

#

And make only 2 scripts

#

One statix class that handles the game

#

And one monobehavior that draws the game

#

You dont need anything more

#

If you're following the tutorial correctly and you got that

#

Then it was a bad tutorial

#

And very confusing

fierce epoch
#

it worked on his thing

#

and yes

#

it confused me a lot

#

especially when i think that the error is due to the this Keyword

barren shale
#

Ok

#

This is like self

fierce epoch
#

anyway i think i'll follow other tutorials, many different stuff

barren shale
#

In python

fierce epoch
#

anyway

#

thanks you for the help i'm gonna figure out some other stuff

barren shale
#

Its hard to change from python to c#

#

Np

fierce epoch
#

and go back to u if i'm really stuck i don't want to disturb you

#

and also don't want to be too dependent to other

barren shale
#

Maybe

#

Try to make tic tac toe in python

#

Then try to translate it to c#

fierce epoch
barren shale
#

That might make it easier

fierce epoch
#

also

#

i'm not doing visual interfaces

#

in python

#

lol

barren shale
#

You dont have to

#

Just a simple console

#

Once you get the game logic in unity

#

Its not that hard to turn it into a visual interface

fierce epoch
#

i mean i have the game logic

#

i already have an idea on how to do it in python

#

and i know how to do it

barren shale
#

You have to think about board games this way

#

Play -> check for wins or draws -> switch -> repeat

#

This is the ge logic

fierce epoch
#

yes

barren shale
#

I didnt see any state checks

fierce epoch
#

anyway

#

i clear my prject

#

i have found an interresting on google

#

talking about the 2 script you told me

barren shale
#

Yea

#

Should be much simpler

#

Good luxk

fierce epoch
#

thanks u

#

for help and everything

barren shale
#

No problem

orchid frigate
barren shale
#

It eats lasagna

orchid frigate
#

Eats the lasagne gameobject and if there is no lasagne it gives you nightmares

summer niche
#

Where do I have to report bugs?

trail ocean
#

coding

valid summit
orchid frigate
#

Anyway so

#

Uhhh

#

I wonder how many people here prefer to use floats then ints even when they know the number will always be full

#

Im definitely one of those people

bold rover
#

So, I Just noticed the way That the Worldbox dev. Fight back Dropping frame rates is by removing the entitie in the"Scene" but not deleting there whole data

#

Are they just compressing the data?

keen shell
#

Maybe they get updated less

bold rover
#

That actually make sense

#

Hmm thanks

main brook
#

also type casting?

#

since they probably gonna pass it to something else that takes float instead of int

orchid frigate
#

Actually now that I think about it I have been using floats way less because of the intRange script

#

It yea you also waste memory

main brook
#

well

barren shale
#

Not to forget

main brook
#

precision cost alot indeed

#

imagine double

barren shale
#

You run the risk of getting
6/2=2.99999999999

#

And you dont want that

main brook
#

oh i forgot

#

precision error

#

in some languages

#

1.999999999 == 2

#

or so

barren shale
#

Its in all languages

main brook
#

well frick

barren shale
#

It just happens at different places

#

In python it can happen in simple math

#

In C# it has to be more complicated

main brook
#

use python with c extension

#

super extra hell

#

you can crash the interpreter with just a small mistake in making custom typed object

barren shale
#

That's why

#

You dont use it

#

Just use C

main brook
#

fair enough

barren shale
#

Unless its a small part of your code that you eant to run faster

main brook
#

when you compile your code and it have 0 errors: noping

barren shale
#

Tru

orchid frigate
#

The average amount of errors my scripts have is probably about 3

#

The problem is that's not just in the development stage, it's also in the finished stage

main brook
#

people when they didn't get any error: Thonk
people when they get error: ping

main brook
#

yeah no frick that

#

i deploy instantly to production

barren shale
#

5 bugs

#

Ahhh yes release build

north dune
barren shale
#

I agree

north dune
#

i get lazy with null checks sometimes

#

and stuff gets crazy

barren shale
#

Did it work ?

north dune
#

no

barren shale
#

Xd

north dune
#

im still stuck, just woke back up lol

#

i think ill just keep the damn shadows for now and find a workaround to delete them later

barren shale
#

Does it look bad with shadows

north dune
#

its obvious they shouldnt be there once you delete the other stuff

#

but no its not "bad"

barren shale
#

Yea

#

Looks kinda thicc

#

Btw

#

I just thought about it

#

You have 2 loops

#

Shouldn't they be nested

#

Not nested should make textures look like

#

xx
X

#

Bested should ve more like
xx
xx

#

Doesn't leave gaps

north dune
#

no

#

gaps are filled by a different scaling value

#

and/or more layers

#

the two loops go in two different directions from the original sprite, forward and backward

#

and then theres 2 others for the other 2 directions, so i can thicken sprites normally and have a rotated thicc version

#

theres no reason to nest them

#

a better question is why im using <= in a for loop

#
        for (int i = 0; i <= 5; i++)
#

higher i = more layers
changing distance scaling changes gap between layers

barren shale
#

It doesn't matter

#

I <= 5

#

Or i < 6

#

You should work on pooling for performance

craggy relic
#

.q

keen shell
#

#🤖bot-commands

craggy relic
#

Couldn't find it srry

fierce epoch
#

@north dune i'm wondering

#

for modding

#

you just modify files without actually seeing what you do in real time

#

and then launch the game to test ?

north dune
#

without actually seeing what you do in real time
what do you mean by this

#

i mean, i can see the code im working with of course, but yes i have to compile and relaunch before seeing how it functions

fierce epoch
#

In unity, you code what you do, you compile and you test in the game window

#

but

#

when you get worldbox

#

you can't turn it back into a unity project right ?

north dune
#

i can i think but thats not how i do things

most of the time you'd use DnSpy to open and make edits directly to Assembly-Csharp file

#

in my case i use bepinex to build a seperate file from everything, just using the games files as reference

fierce epoch
#

and what Maxim and Mastef do in the inspector you can't acces them then ?

north dune
#

right, theres a few things they can do that i have no access to or even visibility for

fierce epoch
#

cuz i'm wondering

#

let's say they lock the camera in 1 axis

#

no

#

they lock the camera rotation

north dune
#

like in the game already

fierce epoch
#

yes

#

you can't change that ,

#

?

north dune
#

considering i do change that with the 3d mod

#

nah

#

you can do almost anything

#

im not remembering off the top of my head what the inspector has that i dont

fierce epoch
#

hmmm

north dune
#

lets say they override the angle constantly, which isnt the case in the game

#

i could find the code doing that and change it, remove it etc

fierce epoch
#

ohhhh

#

that's pretty cool

#

and i got a last question

north dune
#

feel free to ask however many you want lol

fierce epoch
#

i already downloaded "many" mods

#

and their interfaces are always the same

#

is the interface done by unity or somethign ?

north dune
#

my mods are using unity's GUILayout system for convenience

fierce epoch
#

but like

#

cloud's mod too

north dune
#

i push other people to do the same thing

fierce epoch
#

Ah

#

lol

north dune
#

its purely for convenience, manually writing out menu positions or recreating a system entirely is just not worth it

fierce epoch
#

ye

north dune
#

GUILayout looks bland but is amazingly customizable for how simple it is

#

it being simple is why my mods are all named... SimpleGUI

#

you may be interested in how bepinex/harmony works

hoary hound
fierce epoch
#

not atm xzibit

#

i just wanted to know some stuff

#

cuz

#

now i'm learning some stuff on unity

north dune
#

instead of directly making changes to code in the source it does it a bit differently

fierce epoch
#

i was just wondering

north dune
#

ahhh

fierce epoch
barren shale
#

Even decompilers dont decompile the code as its written

#

So its a bad idea to do it

#

Cody's way is probably the best way

#

The best way is for the devs to add support for mods

#

But they probably dont have time for that

north dune
#

there is an official mod loader

#

"experimental mode" in game is for that loader

#

i intend to swap over to it eventually, im just too comfortable with some of bepinex features

north dune
#

gonna require you guys call me senpai just like @dull stump does

acoustic garnet
#

mmmmmmmmmm

#

delicious

#

delicious code

keen shell
#

Ah senpai

#

That word

#

Kids at school used that all the time

tiny whale
acoustic garnet
#

lel

orchid frigate
#

Just wanna clear things up from around here from now on GetField is called Garfield

barren shale
#

Oh really

barren shale
blissful jasper
#

Hey

#

I am pro grammar

barren shale
#

Nice grammer

knotty root
#

I wonder how yandere dev's spaghetti code tastes like

barren shale
#

Spaghetti

barren shale
#

How about daddy

#

Go eat sambosa

knotty root
#

how to change the color of the kingdom

keen shell
barren shale
stark ravine
#

🗿 that sound really horrible

wet girder
#

do you have to deal with pointers in C#?

#

I was just wondering as I've been learning about pointers in c++ today for like 1-2 hours

north dune
wet girder
#

yeah I was thinking that

#

pointers are cool tho

#

just frustrating to learn and to use sometimes

#

from what I've heard

#

I only have experience from learning

north dune
#

C# supports pointers in a limited extent. A C# pointer is nothing but a variable that holds the memory address of another type. But in C# pointer can only be declared to hold the memory address of value types and arrays.

#

still seems useful

#

int* ptr1 = &x;

#

what the hell

#

new syntax spinning_rainbow_sheep

wet girder
#

it is like:
int *ptr1 = &x;
in c++

#

the * placement is way too specific

#

it means multiplication if you place it poorly

north dune
#

lol, incredibly strict syntax

#

that changes by 1 spacing on another language

wet girder
#

lol

north dune
hoary hound
#

The use of pointers is rarely required in C#, but there are some situations that require them. As examples, using an unsafe context to allow pointers is warranted by the following cases:

Dealing with existing structures on disk

Advanced COM or Platform Invoke scenarios that involve structures with pointers in them

Performance-critical code

#

Apparently they aren't used a lot

#

(this was copied from stackoveflow lol)

wet girder
#

the first 2 are just better to do with c/c++ lol

#

but if you need them in C# program yeah

hoary hound
#

Yeah you don't usually use pointers in c#

wet girder
#

but sounds like rare use

hoary hound
#

Objects are automatically passed by reference

wet girder
#

You have to use pointers a lot in c++ as far as I am aware

#

or well you could go without them (sometimes atleast) but they're way more clean to use and make code way faster (most of the time)

hoary hound
#

C# uses a lot of more abstraction than c++, that's why you can "forget" about some more technical and hardware related stuff and focus on the algorithm

wet girder
#

yeah true

hoary hound
wet girder
#

they are at first but I've got used of looking at them

#

declaring objects tho

#

that is so fucking weird to me

#

and constant functions in objects

#

or just constants

#

those don't exist in python

hoary hound
#

Constants don't exist in python?

wet girder
#

I always start to do:
ClassName = obj;
but it's just
ClassName obj;

wet girder
hoary hound
wet girder
#

never knew

hoary hound
#

I've never used them anyway

wet girder
#

They'd make code more readable tho

#

as you know what variables are never gonna change

#

but constant functions and classes

#

holy shit those are weird

hoary hound
#

Constant functionswat

#

Are functions supposed to change during runtime hagrid

wet girder
#

I mean these

#

also function overloading is new to me

#

but it is super cool

hoary hound
#

You mean doing

int foo(int bar)
int foo(string bar)
#

Is this overloading?

wet girder
#

yeah

hoary hound
#

Oh right I almost mixed it up with overriding

wet girder
#

what's that

#

When the base class and derived class have member functions with exactly the same name, same return-type, and same arguments list, then it is said to be function overriding.

#

hmm

#

why would this be used

hoary hound
#

Do you know how inheritance works in Object Oriented Programming?

wet girder
#

a little

hoary hound
#

Ok just a second they are calling meJerry

wet girder
#

I wonder who are they

hoary hound
#

It's them

#

Anyway

#

So basically when you inherit from a class, you can override a method and change how it works but I'm pretty sure you can't change what it returns and the parameters.
To make an example, we have class Car, that has a method public void Start() that makes the car.speed increase by 10.
We can make a FastCar class that inherits from Car, and by doing
public void override Start() we instead changed the speed by 20.
This is not the best example but it's the only one I could come up with :Tom:

knotty root
#

Poop

hoary hound
#

Thanks I guess

knotty root
#

Poop is good

hoary hound
#

The implementation in the subclass overrides (replaces) the implementation in the superclass by providing a method that has same name, same parameters or signature, and same return type as the method in the parent class.

#

So yeah you keep the same function signature, but the code inside the function itself can be changed

wet girder
#

cool

#

I need to think of a project idea in C++

#

I want to do something with GUIs maybe

#

but Idk what

#

I have rare chance to code 10pm on my pc so I am using it to the max atm

#

my brother wants me to create app that has button that gives you random monke image

#

fuck it why not

knotty root
orchid frigate
dense shuttle
#

Yea I’m a coder. Look at me code.

if
{Phallus} = stitched_shut
Then
{Climax} + 100 Agony

barren shale
#

Theres probably a ton of them out there

north dune
#

but now after a couple hours, i can save and load menu positions despite Bepinex not supporting Rect in its config stuff

#

[Info : Unity Log] Loaded window position: 636, 0, 0, 0

astral basin
#

how does the original string look like?

north dune
#

Saved main pos: (x:705.00, y:237.00, width:200.00, height:251.00)

#

after : is the Rect.ToString

#

simple stuff i think but was annoying

#

and all because the OG looks platform dependent

astral basin
#

and how are you getting the rect?

#

you get it with rect.ToString ?

north dune
#

yeah

astral basin
#

can't you rect.ToJson

north dune
#

probably

#

but

astral basin
#

and then just JSON.Parse(abc)

north dune
#

i dont use json

#

if i start using it i could swap stuff, this was done because bepinex config supports saving lots of types but just not Rect

astral basin
#

i mean instead of this (x:705.00, y:237.00, width:200.00, height:251.00)
you get this {"x":705.00, "y":237.00, "width":200.00, "height":251.00}
and then it's easily parseable from anywhere

#

no need to reinvent the wheel then xzibit

north dune
#

isnt parsing it the same either way

#

all i had to do was split it up

#

luckily this is the kind of thing i can do once and forget about lol

#

how bad of a practice is using lots of InvokeRepeating?

#

im up to 3 now and thinking i could avoid it if i needed

astral basin
#

what type is rect

#

ah just Rect

#
string rectString = JsonUtility.ToJson(myRect);
Rect myRect = JsonUtility.FromJson<Rect>(rectString);
north dune
astral basin
#

i think it's in traits loader or assetmanager as well

#

a more powerful json lib is used in save files

north dune
#

ive tinkered with it a tiny bit to help with a bot

#

json seems very convenient

#

i just havent swapped around lmao

#

think i was originally trying to parse online commands with json

astral basin
#

yeah

north dune
#

but gave up quickly to go back to what i understand

astral basin
#

i think json is one of the simplest online data structures, it was a blessing after xml

north dune
#

now that these positions are being saved im going to wind up unintentionally trolling people who move them off their screen to hide it

astral basin
#

oh yeah as long as you have a "reset positions" button xzibit

north dune
#

yeah

#

R resets everything else in my stuff so

#

like ctrl r for menu i guess

#

cant hit the GUI button to reset it if you move the GUI off the screen

#

fmp is the reason i thought about it at all lol

astral basin
#

oh yeah

barren shale
#

xd

fierce epoch
#

hamza

#

i have a

#

super important question

#

lol

barren shale
#

sure

fierce epoch
#

can i go dm ?

barren shale
#

ye

trail ocean
#

dying noisy
I finally fixed the last issue ahhh

fierce epoch
#

i hate lists in C#

hoary hound
#

why?

#

They are more intuitive than arrays

#

Although they are almost the same thingoink

wet girder
#

I've fallen in love with arrays

hoary hound
#

I kind of disliked arrays after we got into pointers with c++

#

You know stuff like looping through arrays with pointers

#

Very confusing

orchid frigate
orchid frigate
#

I'm triggered

fierce epoch
#

i'm

#

so new to c sharp

#

and

#

list in python

#

are way more easier

orchid frigate
#

Easier doesn't always mean better hagrid

hoary hound
#

^ facts

fierce epoch
#

also

#

why is this wrong

orchid frigate
#

To my knowledge everything

#

What are you trying to reference

#

Random int? Number?

#

Or something else

fierce epoch
#

i try to have an int variable

#

from

#

a the

orchid frigate
#

Ah

fierce epoch
#

function

#

Random

#

()

orchid frigate
#

Well it's more complicated then that

fierce epoch
#

._.

orchid frigate
#

Ok so

#

A couple of messages ago I showed a script

#

Which is very useful

#

It's called IntRange

#

Basically it manages to get an int from a certain range

#

Lemme find the message

fierce epoch
#

i need a number between 0 and 8

#

so like

#

i want it to be able to choose 0

orchid frigate
#

Ok

fierce epoch
#

cuz

#

eh

orchid frigate
#

Here it is

#
using System.Collections;
using System;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public class IntRange 
{
    public int m_min;
    public int m_max;
    public IntRange(int min, int max){
        m_min = min;
        m_max = max;
    }
    public int Random{
        get {
            return UnityEngine.Random.Range(m_min, m_max);
        }
    }
   
}
#

Then you just reference it in another script

fierce epoch
#

oh boi

orchid frigate
#

In reality you don't need it

#

The command to return a random int in a range is just

Return UnityEngine.Random.Range(numberMin, numberMax);
barren shale
#

Random in unity is a static class i think

#

You cant new a static class

barren shale
fierce epoch
#

so

#

uh

barren shale
#

You just use the class as it is

#

Random.

#

Instead of
Random rnd = new Random();
rnd.

fierce epoch
#

i mean

#

i can just do

#
int rand = Random.Next(0, 8);
#

no ?

barren shale
#

Range instead of next

fierce epoch
#

wdym

#

wh

#

why

orchid frigate
#

I never use these commands so can't really help

#

I just use the intRange script

barren shale
#

The unityengine overwrites the system library (normal C#)

#

Its a bit confusing

#

Cuz they seem the same

#

But they're different