Giter VIP home page Giter VIP logo

godot-2d-builder's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot-2d-builder's Issues

Error when adding a Battery

I'm submitting a...

  • [x ] Bug report.
  • Feature request.

Bug report

What is the current behavior?
When you run the project and add a Battery, the program crashes.

What is the expected behavior?
It should add the Battery object in the map.

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.

  1. Click on the start button
  2. Grab the Battery from the bottom inventory
  3. Place it anywhere on the map

The error occurs in BatteryEntity.gd in line 25
It tries to get the variable _power_indicator and it should be _power_direction according to the variables from that Entity.

Doc request

  • Doc request.

Had a request for some docs or at least notes on a few things. First, all of the game-controls, second, how to use the game (I found most of the keys in the keymap and game course, but not how to actually use items). I'm sure having gone through the course it would all be apparently, but I'd like to run it first.
Additionally, it's not clear what start-project/1/2, correlate to. In the GDQuest Godot 2 Secrets course, there are three blocks, "Simulation-Builder", "Simulation-Builder-UI", "Simulation-Builder-Craft", but the project-code doesn't seem to match those.
Thanks.

Crash when deconstructing an entity when last fuel is consumed.

I've found a bug when deconstructing the StirlingEngineEntity and the FurnaceEntity when the last fuel is consumed, no need to be fully consumed. For example, if you put a single Lumber in the StirlingEngineEntity, this Lumber is deleted but the engine will work until is fully consumed. If you then deconstruct the item, the game will crash, if you let it to be fully consumed and then deconstruct the item, the game will crash too:

Invalid call. Nonexistent function 'get_parent' in base 'Nil'.
0 - res://Systems/EntityPlacer.gd:207 - at function: _drop_entity
1 - res://Systems/EntityPlacer.gd:275 - at function: _finish_deconstruct

An easy fix would be to wrap panel.held_item with is_instance_valid in get_inventory() function of InventoryBar.gd:

func get_inventory() -> Array:
	var output := []
	for panel in panels:
		if is_instance_valid(panel.held_item):
			output.push_back(panel.held_item)

	return output

But then I thought why the held_item is not null in the first instance, I started looking more deeply, and I found that the fuel is freed in the entities but in the panel is not set to null.

# StirlingEngineEntity.gd & FurnaceEntity.gd
# ...
func _consume_fuel(amount: float) -> void:
	# ...
		if gui.gui.fuel.stack_count == 0:
			gui.gui.fuel.queue_free()
			gui.gui.fuel = null
	# ...

After analyzing and thinking what would be the best solution I thought that adding is_instance_valid everywhere feels wrong to me. And then I thought that using the GUI to store and manage the actual Blueprints and inventory it felt wrong to me also, from the very beginning, the GUI is doing too much.
Wouldn't be better to decouple the inventory system that manages the items and inventories and let the GUI care only about showing and displaying that data?
The inventory could have a function to delete an item from an inventory, free it from the memory and then emit a signal so others could nullify the variables.

Anyways, I've already overthought it too much. I've made a pull request with the easy fix: Fix deconstruct when last fuel is consumed

InventoryPanel::_is_valid_filter could return wrong value

So far how function is written now it only searches for any substring in filter string. This though could return false positive in case that given type is a substring of type in filter. As an example let's say there are two types Coal and CompactedCoal if you want to make machine (maybe same goes for recipes i did not check that case) that takes only CompactedCoal you are out of luck as _filter.find("Coal") search will be positive even though there is filter for CompactedCoal only.

Simple proposed solution would be to make filter either array of strings and do equal compare or split _filter string in _ready to make it a array so you can make whole filter little bit more strict.

I'am sorry if it is too soon to report such stuff. I just can't wait for course so i'am just going through code and thought processes behind commits trying out how stuff works in advance :D Looking forward to final tutorial :-) great work!

It is possible to open multiple machine GUIs at once

When you click on machine backpack and machine GUI opens. Then when you click other machine (without closing previous one) it stacks on top of the previous one in same window :D
Snímek obrazovky 2020-10-11 v 11 38 34

Repro steps:

  • Start game
  • Build 2 machines
  • Go to a place where you will be able to click on machines even when GUI is opened
  • Click on ope machine to open its inventory
  • Click on other machine (without closing previously opened GUI)
  • DONE, you have both machine GUIs in single window

Expected:
GUI of previous machine should close before opening new one.

Viewport issues

I'm submitting a...

  • Bug report.
  • Feature request.

Bug report

What is the current behavior?

The viewport/aspect ratio seems to be messed up with holding blueprints vs. placing them. They are placed correctly, but holding the blueprint it is very off

What is the expected behavior?

Blueprint location matches placed location

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.

Run the godot folder in simulation_game folder

Other

Other information

  1. I have turned off 2d and expand mode within the stretch settings and this seems to fix the error so it must be some weird offset happening with the game scaling to 2d mode.
  2. Enabling borderless mode also fixes the issue without disabling 2d or expand...

Screen Shot 2021-07-29 at 18 50 48

Screen.Recording.2021-07-29.at.19.46.48.mov

Possible Blueprint leak in FurnaceGUI.gd

In function grab_output is checking held_item_id == item_id but there is missing case what to do if not.

In simplest case item.queue_free() should be called for missing else code branch to release BlueprintEntity. Ideally some handling so player does not loose this prepared item.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.