Comments (16)
Hey, sorry for the radio silence.
This has progressed, just need to clean up a bit more and do a proper documentation.
But here's the summary so you can start working on your own wieldable.
This is also how they're set up in the current latest version 202401.15:
- the pickup of your wieldable can/should be a regular pickup
- the item resource of your wieldable should be assigned to the slot of your pickup.
Now the trickier part:
- Your wieldable model/mesh and their logic need to be attached/a child to a Node under
Player/Neck/Head/Wieldables/
- The node needs to have the same name as the string name of your wieldable item resource.
- The node also needs to be added to the Wieldables node array of the PlayerInteractionComponent
Finally your wieldable logic needs to contain at least these two functions:
action_primary(_camera_collision:Vector3, _passed_item_reference:InventoryItemPD)
action_secondary(_is_released: bool)
_camera_collision is used for spawning projectiles if needed. _passed_item_reference is used to update your item resource.
_is_released is used to create behaviour that reacts if the input for action_secondary is being let go (used for aim-down-sights for example)
The Wieldable_Flashlight.gd and WieldablePistol.gd are set up with these, so I can recommend just looking/copying those when you want to setup your own.
from cogito.
Hey, no, haven't really changed anything else as I was working on the Quest system.
If you wanna take another look at it be my quest, I would be keen how to set something like this asset up with Cogito's system to see if there's more stuff to improve: https://levraicoincoin.itch.io/animated-fps-pistol
from cogito.
@Phazorknight Hey thanks for the constant updates! I haven't seen this being suggested yet, but are you also planning to do a melee wieldables? A simple baton or a crowbar would be cool.
I found a reference to melee on the wieldable settings on the readme, but I couldn't find anything on the demo scene. Changing the Wieldable Range and Wieldable Damage to a non-zero value also didn't seem to do anything.
I think for starters, just a simple click -> play one animation -> hit would be pretty good already. And then later do something more complex like sword swinging right-to-left-to-right animations, blocks, parries, power attacks. Some of that might be out of scope for this template, though.
I like how Gloomwood does it, it looks pretty old-school. And here are also some Godot examples.
from cogito.
Holy smokes that Soulslike template is mighty impressive.
And yes, I'm planning to add a simple melee wieldable soon.
My idea would be something like a crowbar that moves a damage area around in front of the player when swung and applies damage to objects inside of it.
And then later do something more complex like sword swinging right-to-left-to-right animations, blocks, parries, power attacks. Some of that might be out of scope for this template, though.
As this is very game-specific design, I'm not planning on examples for that, but the wieldables are set up in a way that custom behaviour like this should not be too hard to implement. The basic framework to create stuff like blocking or charge attacks is in place.
from cogito.
I've just added a new melee wieldable: a Pickaxe.
It uses an Area3D, which has it's monitoring property switched OFF per default.
When swinging, the swing animation turns the monitoring propery ON, thus detecting if it hits any objects with a HitboxComponent. If it does, damage based on the WieldableItem damage is applied.
You can test this by hitting the TargetDestructables in the scene.
Using an Area3D this way should allow pretty good customization about shape and timing.
The pickaxe has currently no secondary option, but if anyone wants to try implementing a block or charged swing or whatever, that's a great spot to experiment.
from cogito.
Nice!!! Wow that was quick, thank you so much!
from cogito.
Basics of new Wieldable system are in place.
A couple more todos:
- Clean/restructure up how the Wieldables are placed in the Player scene for animation handling.
- Add Reload functionality.
- Polish Wieldable Info HUD area in screen bottom right.
from cogito.
Just to update this here:
- Reload functionality is done.
- Still need to clean up Player scene wieldables a bit / make it clearer on how they're setup.
from cogito.
What's the progress here? I've been working on implementing a key 'wieldable' and would like to see your changes before I submit a PR
from cogito.
Hey everyone,
Wanted to give an update that I'll try to improve this more, so if you're working on your own wieldables, be aware that some changes are coming.
- Wieldable Nodes that are part of the Player tscn will also be turned into tscn's to allow better modularity and maybe even instancing.
- Will try to move Wieldable animations inside of them.
- Making the wieldable actions be controlled by signals to improve decoupling that currently causes bugs and crashes.
from cogito.
First bigger steps toward this are now out in update BETA 202402.10.
In regards to using signals, I'm currently not sure how useful this is in practice as the player interaction component has to handle any wieldables pretty directly and usually ever only one at a time.
from cogito.
Perhaps as an alternative to signals you could utilize a base class with a class name like Wieldable that had the necessary functions defined in it.
Then to make a new wieldable we can extend Wieldable and implement our own function logic.
from cogito.
@Phazorknight, are you still planning more changes to wieldables? I think everything you've listed here is pretty much complete now.
from cogito.
Another update, mostly related to wieldable handling, not too much to the wieldables themselves.
This should reduce unexpected behaviour when swapping/reloading wieldables, as there are now checks in place to stop other actions when swapping or reloading takes place.
from cogito.
Awesome! Looking forward to it.
And yeah that Soulslike template is crazy. If you go to the author's YouTube channel, he probably has the most detailed guide and devlog for any Godot template ever.
from cogito.
Closing this as the Wieldables have been fully redone since I first opened this issue.
from cogito.
Related Issues (20)
- Making an object throwable and support for physics objects? HOT 4
- Cogito Objects that aren't unchanged instanced of their scenes / have overrides do not save/load properly HOT 2
- InteractionRaycast doesnt appear to be working at all HOT 4
- Making a Grid Inventory HOT 2
- Missing Parameter in door sync code HOT 3
- [Improvement/Suggestion] Stealth / Brightness Improvements HOT 4
- Invalid get index 'interactive_object_detected' (on base: 'Nil') HOT 6
- Inventory system / grid based: Using item while moving another one can override/delete it. HOT 2
- Quest: Steal the laptop - win condition doesn't get triggered - item checker issue? HOT 2
- Inventory System / Grid based: Item graphic doesn't get position correctly on move (game pad) HOT 1
- Character gets stuck on stairs HOT 4
- A character flies a crate HOT 5
- When opening the inventory, the player is frozen while the world keeps moving. HOT 2
- The platform pushes the player off the map if you stand under it HOT 3
- Flashlight not always turning on/off properly when used while walking/running. HOT 4
- Multiple interactions can occur with a single button press HOT 4
- Unrelated inventory squares are highlighted when squares are selected
- Inventory item tooltip remains visible when mousing off the inventory panel HOT 2
- Game crashes when pressing Esc afther going to the laboratory from the lobby HOT 3
- SubViewport as Root causes errors HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cogito.