If your bullets are children of the same container you can loop through those and hide/show based on your ammo value var bullets: Array[Control] = %AmmoUIContainer.get_children() for index in bullets.size(): var bullet: Control = bullets[index] bullet.visible = magammo > index
Godot Version 4.6.1 Question I’m making a FPS gun where the amount of ammo in the mag is displayed physically. Instead of a HUD, the bullets are shown as 3D models that appear/disappear with how much ammo is left. I have modeled this, but I am unsure how to code what I want in. I think arrays are used for this, but I’ve looked at the documentation and honestly I’m not sure, can’t seem to figure out how to use them anyway. So I’m asking here This is my current code, obviously inefficient but…
I should clarify that the “previous map” I mentioned is the default test map, an instanced scene which starts off as a child of mapRoot. The NavigationRegion is baked around this map before the game starts, and the player’s navigation works perfectly until changing maps.
Godot Version v4.7.2.stable.official Question I’m building an RTS game where the player can travel between small maps. Apparently I don’t know how to build a new navigation polygon when loading a new map. “mapRoot” is a node to which the various maps can be attached. These maps contain TileMapLayers where some tiles have collision. I successfully rigged up a system by which the player is transferred to the correct point on a new map. However, the NavigationRegion2D needs to be updated with a…
Abducktion - Day 5 Walking ducks Transitioning to swimming ducks The first swirl Next up Because I am pretty happy with the flying experience for now, I will postpone camera zooming for now. The next order of business will be a little more in my comfort zone. Scaffolding some long term data structures and core code: but first, a 3 tick visual timer that indicates duck docking completion the first time a new subspecies is caught, a compendium entry appears big on screen, game is paused after…
To be completely honest, the pacing remains slow and there’s a heavy dependence on dialogue and cut scenes. The pace does pick up in the final chapter, which also has a lot of action and builds up to a cathartic release. This game probably isn’t everyone’s cup of tea, but I’d definitely recommend it to anyone who is into good stories and storytelling. I’m such a person, and I find that many games that try to tell a story do so in the most ham-fisted way imaginable. They over-explain what is…
What about a dedicated ItemParameter class? ItemFloat, ItemInt/Bool etc. Then you can embed the var stackable:bool into the parameter itself and tick it in inspector, and everything else would be automatic. Tho to make it look nice you would need inspector plugin code.
I’d say you are on the right track. I do the same in our game Manabies. My stacking identifier us something like "{id}__{modification}__{text_overlay}" The arrow items in the toolbae at the bottom have a differrent modification (arrow direction), so that keeps them from stacking.
Currently I just have add_item functionality, but here it is: class_name InventoryComponent extends Node signal entry_added(entry: InventoryEntry) signal entry_modified(entry: InventoryEntry) @export var display_name: String = "Default Inventory" var entries: Dictionary[String, InventoryEntry] # For easy lookup var entry_list: Array[InventoryEntry] # For UI and sorting func add_item(item: ItemInstance) -> void: var stack_key: String = item.get_stack_key() var entry: InventoryEntry =…
I never really gave this game a real try, but I have been listening to the soundtrack a lot. I really like the tracks Woody Path and Valley of Junks, to name a few. The start of the game felt really slow. How is the pacing of the game overall?
Your making your own specialized serializer/marshaller, this is very common and only as complicated as you make the format. You haven’t given us the stacking code, I assume entry.stack_item so we don’t know how you are actually storing/de-serializing this data, nor do we know your greater inventory system so detecting pain points is difficult from here. If it doesn’t cause you any troubles then it’s great!
It was the order of the nodes that was the problem. I was changing their process physics priority to make the bottom one process first but I tried switching it after seeing your post. When the top one processes first, for whatever reason it appears smooth.
Godot Version Godot 4.8 (rcl) Question I’m trying to make a POI defense, beat 'em up style game with a similar feel to Brotato. Since mine is entirely melee, i thought it would be a good idea to make an indicator that shows the direction you’re melee-ing in, which is the mouse direction. I use a Polygon2D for that. It works fine, but there seems to be an offset from the mouse that I don’t know how to deal with. Here’s the scene tree; and the code; extends CharacterBody2D func…
Yeah I think for me it’s a toss up between Halo and ocarina. I greatly appreciate Nintendo’s insistence on using heavy classical influences in the Zelda franchise. There are so many timeless pieces in ocarina it’s hard to pick *Shoot, I forgot about Skyrim. Never mind, it’s a three-way tie Zelda Original Soundtrack - Song of Storms
Godot Version 4.7.2 Stable Question Would it be a bad idea to have something like: class_name BaseItem extends Resource func get_item_data() -> ItemData: # override this return null class_name Item extends BaseItem @export var item_data: ItemData func get_item_data() -> ItemData: return item_data class_name Weapon extends BaseItem @export var item_data: WeaponData func get_item_data() -> ItemData: return item_data Where WeaponData would extend ItemData It’s more boilerplate but it would make it…
normalized: This was rendered with the forward renderer but environment glow should work with compatibility in 2D. I can confirm this works in OpenGL in 4.7, I simply dialled up the intensity value in modulate… Last time I tried it was in 4.4, I don’t think it worked back then.
Hi, sorry I’m responding very late to this. My motherboard and CPU quite litteraly burned a few minutes after last replying here and it took some time before I dared to use Godot again after this, I had a hard time convincing myself it was not necessarily related. It seems to have been an issue with timers, because I ran in a similar issue in a 2D project soon after I added more than one timer with small intervals (something like 0.02 sec) in the same scene. I deleted all timers and never…
normalized: So best to keep the animated bezier point count low and wherever possible animate transforms instead. Other than that, once tessellated vector shapes are just polygons so that shouldn’t be much of a problem if there’s no a lot of overdraw. Planning to add the VisibleOnScreenEnabler thing to all the ducks (that have shapes being deformed at the Bézier level). I turned on adaptive V-Sync, but also, my main monitor is pretty low end; if I use the small laptop one it’s fast… …On mobile…
Defense game devlog #2: Making the characters is the most fun part? Once I settled on a defense-style game, the first thing I did was generate character illustrations. I know that’s not the “right” order for making a game, but I figured it would be the most fun part, so I started there. I think I made about 100 images with ChatGPT today. I made the same cast in 4 different styles, and my favorite is the top one (the original). I’d love to hear what you all think! And what should I do first…
I didn’t get any stutters running your demo in Edge. Could run at 60 in a browser, depends. Your main bottleneck will likely be per-frame vertex buffer refresh if a lot of skeletal and curve animations are at play, and possibly gradient textures refresh if gradients are animated. So best to keep the animated bezier point count low and wherever possible animate transforms instead. Other than that, once tessellated vector shapes are just polygons so that shouldn’t be much of a problem if there’s…
Some feedback I’ve been getting is that the game is “surprisingly deep”. At first I took this as a compliment, but over time I’ve understood it to mean that most-all players have no idea what is going on. One example was the forecast display. I opted to break the year into seasonal periods instead of the in-universe months. I may change it to be groups of 4 but for now it’s based on significant weather changes. Humidity is complicated because the game uses a dew-point table to decide how thick…
The Swell tech demo will also have a feature to split the picture, plain Godot water (a plane with two scrolling normal maps) on the left and Swell on the right.
Hi @FrancisCharlesIII, did you manage to fix this? It sounds like an issue with maybe collision layers? It would be helpful if you could better describe the issue maybe including some pictures of your current setup.
So_U_Rav: For a Gun Sprint clone, is it better to use apply_central_impulse() combined with apply_torque_impulse(), or should I be applying a single apply_impulse() offset from the center of mass to let the physics engine naturally handle both the push and the spin? I think that if you have already gone with rigid bodies you might as well use them fully and apply an offset impulse. Although, being honest, I usually prefer to avoid physics for things that have to feel snappy and arcade. I worked…