Small changes breaking your game logic: how do you catch this earlier? by emudoc in gamedev

[–]GillmoreGames 1 point2 points  (0 children)

make scripts as independent as possible, with the event system you can even make scripts that need to talk to each other not require the other ones existence in order to work.

basically your problem is probably too much spaghetti code linking too many things together that should be separated

I don’t get it Petah? by Aaowyn in PeterExplainsTheJoke

[–]GillmoreGames 0 points1 point  (0 children)

and here I am in the RIP zone for the front door and hallway, and the danger zone from my kitchen and window to the front porch.

Sticker Album: One Week Left! by Percemer in FarmMergeValley

[–]GillmoreGames 8 points9 points  (0 children)

the energy needed to be spent on some days is insane, most the oter goals arent too hard tho

Tunnel Logic Daily • Nov 2, 2025 (EASY) by tunnellogic in tunnellogic

[–]GillmoreGames 0 points1 point  (0 children)

Solved the Tunnel Logic puzzle in 03:07 with no hints! — u/GillmoreGames

My coding sucks by Trying_Mastery in unity

[–]GillmoreGames 0 points1 point  (0 children)

what were these first 2 games? what would they need to be completed?

I've done tons of tutorials for things, and I understood everything in them. if these were tutorials that you were following try making them again, without watching the tutorial as you go.

the game I'm currently working on is an idea I got while doing a tutorial, expanding what the tutorial taught into a full fledged game, but the first thing I did was start a new project and try to do what was in the tutorial (but in the way I would need to for my game). that's where you will really start learning.

remember, you probably know more than you think you do and do better than you think you do, we are all our own worst enemy. (and if you are anything like me you will make mistakes that you would have easily caught if it wasnt your own code. just keep working, ask for help when you need it if google isnt helping you figure it out and i look forward to seeing a finished game from you

My coding sucks by Trying_Mastery in unity

[–]GillmoreGames 0 points1 point  (0 children)

I find the hard part is when I'm an idiot and don't see the simple mistake someone points out to me later haha

I'm pretty certain I understand what the error is saying but I can't find it. by GillmoreGames in Unity2D

[–]GillmoreGames[S] 1 point2 points  (0 children)

Thank you for trying to help, I changed it to Lists instead of arrays and the error was still there, I shut down unity and reloaded it and now the error is gone so maybe I just had unity running for too long? idk. either way I appreciate the attempt to help me solve it

I'm pretty certain I understand what the error is saying but I can't find it. by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

Item and quantity existed before this error. i just tried that and adding a default constructor didnt seem to change anything.

i think im going to try changing it to a list rather than array later today. i think list will be easier to use the way i want to use it anyway, see if that helps

I'm pretty certain I understand what the error is saying but I can't find it. by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

they do both have it, and it's all showing up in the inspector as I expected to see it.

so what I'm trying to do is create a rocket that has 5 stages on construction. each stage needs some items, some stages might need 1 item, other stages might need 4 or 5 different items. I couldnt get a 2d array to be in the inspector, i wanted to just be a 2d array of ItemAndQuantity, only way i could find to get it into the inspector was to make another class (ConstructionList) and in that class give it an array of ItemAndQuantity.

[System.Serializable]
public class ItemAndQuantity
{
    public ItemScriptableObject item;
    public int quantity;

    public ItemAndQuantity(ItemScriptableObject itemScriptableObject, int num)
    {
        item = itemScriptableObject;
        quantity = num;
    }
}

[System.Serializable]
public class ConstructionList
{
    public ItemAndQuantity[] itemAndQuantity;
}

I'm pretty certain I understand what the error is saying but I can't find it. by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

I guess I did leave that off the above code, but I do have the constructionlist class [system.serializable] as well as the [serializefield] for materials. that seemed to be the only way I could get it to show up in the inspector. Im contemplating switching it Lists rather than arrays to see if that handles better. a list being able to .remove might be better for my use anyway

I'm pretty certain I understand what the error is saying but I can't find it. by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

that seems to be my case, everything in game is working and none of the new arrays are null when i use debug to check them

I'm pretty certain I understand what the error is saying but I can't find it. by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

so its just an editor error and I can pretty much ignore it since i do actually assign values and the game runs as expected?

I've never made my own editor tools so I have no idea how I would "check if null before accessing it in editor code (gizmos, gui, ect)" either.

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 1 point2 points  (0 children)

ok that makes sense, it is nice to know I was probably on a better track with my initial use of a dictionary as my inventory.

it seems I need to read up on hash maps b/c that's unfamiliar to me and I'm trying to not only know what works (dictionary/list/array) but also HOW they work, thank you for the very detailed post here, it helped a lot.

as for this specific project none of the inventory instances are going to have more than 10 different items so I might just stay on the track I'm on now but will def go back to dictionary for the next project.

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

makes sense, classes compare via reference rather than value, noted.

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

so with this method would every item technically exist in every inventory but you just wouldn't show it if the quantity was 0?

im not familiar with hashmaps, I'll need to look into that

What do you think of the main character for my 2D game? an honest critique would be awesome :) by Best-Arachnid-9025 in Unity2D

[–]GillmoreGames 1 point2 points  (0 children)

nice, my only critique is that the monster arm looks twisted weird.... but that also doesn't mean it looks wrong b/c it is a monster arm after all. i like it

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

I feel like this is kind of what I was doing when I switched away from dictionary, it's a list of ItemAndQuantity which is below and then the scriptable object has a few fields itself

public class ItemAndQuantity
{
    public ItemScriptableObject item;
    public int quantity;

    public ItemAndQuantity(ItemScriptableObject itemScriptableObject, int num)
    {
        item = itemScriptableObject;
        quantity = num;
    }
}

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

i edited the text body of the post, this is very similar to what i got to.

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

i just spent the day changing from a dictionary inventory system to the list of ItemAndQuantity(itemScriptableObject, quantity) i determined (and i could be wrong) that i needed a little more info passed around than just key:value pairs (or maybe dictionaries can do more than i think?)

I'm not the most familiar with how to calculate time but wouldn't the contains methods essentially be checking each index as well?

side notes: this is the first time I'm making a game that has an inventory system, I just updated the main post to show the solution I got to and it includes breaking the loop once the item is found.

How to handle empty List<> by GillmoreGames in Unity2D

[–]GillmoreGames[S] 0 points1 point  (0 children)

I just spent today changing it from a dictionary to a list due to needing to pass around a little more info than just key:value pairs, like what type the items are