gdquest-demos / godot-2d-builder Goto Github PK
View Code? Open in Web Editor NEWA simulation game demo made in Godot and inspired by Factorio.
License: MIT License
A simulation game demo made in Godot and inspired by Factorio.
License: MIT License
I'm submitting a...
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.
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.
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.
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
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!
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
Repro steps:
Expected:
GUI of previous machine should close before opening new one.
I'm submitting a...
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 information
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.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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.