Godot: is there any way to stop a node that's following a path? - godot

More specifically, is there any way to stop a node that's following a path when it comes across (overlaps) one of the points on that path?
I am trying to make a game with movement like in FTL Faster Than Light, where when you click in a certain space your crew will move to a spot in that area.
I have been using a Path2D and a PathFollow node to make the crew follow the path, and if they come across an area2d node they will stop. However, this does not really fit what I need, because the crew stop before they actually get to where they need to go.

Related

Godot: Position2D node not sending proper location

I am new to Godot and am currently making a roguelike game. It's in the very beginning stages, but I am stuck on one specific part. I have a system set up so that when you click on a certain space, the player will move to the position 2D node associated with that space. However, whenever I actually try it out, after clicking in the area the player moves to what appears to be a set area instead of where I want.
With this problem, I have no real idea how to fix it or what to search for on the internet because I am new to Godot and game development. I was hoping someone could answer my question directly here.

How to get the position of a different object in gdscript?

I have a player, and I want to be able to detect when they are near a ball so they can press 'E' to kick it.
I'm new to godot and I'm probably just dumb but I can't figure out how to get the position of another object.
I have 3 separate scenes: MainScene(Node2D), Player(KinematicBody2D), and Ball(RigidBody2D). I want to attach a script to one of the scenes that detects how close the Player is to the Ball so they can kick it.
I'm not sure if I should attach the script to the MainScene, the Player scene, or the Ball scene and to be honest, I'm not entirely sure how the code should look. I'm not very familiar with the functions and the node/scene hierarchy is a little confusing.
I am familiar with Python, I just think I'm overwhelmed with this engine (its my first time using a game engine) and I'm having a bit of a tough time grasping it.
Any help would be greatly appreciated!
Side-quest: If you are feeling extra helpful I also need to figure out how to stop a RigidBody2D object from moving until the player hits 'E' on it to kick it!
For this you want an Area2D, which is purpose-built for "detecting nearby objects" without interacting with them physics-wise. Have an Area2D as a child of the Player node and connect the Player node to that Area2D's body_entered signal. Here's a tutorial on using Area2D for further info; this tutorial also links to various other tutorials that could be helpful.
i think you maybe use function
get_overlapping_bodies()
(of Area2D node) for detect another areas or body

How did Epic Games achieve this 3D effect on their Fortnite site?

I have been looking at Epic Games' Fortnites Website and I am trying to figure out how they achieved the 3D effect on the page:
Epic Games' Fortnite website - scrolled down to 3rd slide
Does any one have any idea how to do it? I would really like something similar to a project I'm working on. I have found Three.js, but I am quite sure that is not the solution they went with.
For these types of questions, i can only recommend to install spector.js and have a look yourself. In short: everything you see is 100% faked.
I mean, that's always the case. In fact, if you want to build something like that, your first question should always be: how much of this can I fake and still get away with that?
In this example, it turns out: everything. Just open the devtools and click through all the assets in the network-tab. You will find these two textures:
looks familiar, right?
So what they appear to be doing is they are using three.js with some custom shaders to handle the translations, the flickering of the lights and the highlighting. These effects are computed using the normal-map and an additional mask-texture which I couldn't quite figure out what it does. But again, if you look at the scene in spector.js you can see the shaders used for every drawcall.
The only thing that is a bit more complex is the little robot-friend in the bottom left corner. But again, it's not 3d as in meshes and so on but rather a set of flat textured quads running a bones-animation thing.
I think that makes it a really great website after all.
Given that epic is building the unreal-engine I would suspect the original renders were done there. And I agree, the lighting looks really amazing :)
It is a simple parallax effect using animated sprite sheets.
Parallax effect is achieved by using several layers of images/video on top of one another in different Z-depth.
You can achieve the moving part by using the mousemove event to track the cursor.

Controlling depth buffer and drawing order in OpenSceneGraph

I'm working on a little GIS app using OSG, but i'm quite a newbie with it.
As the view is not changing a lot, i'm not struggling to keep a decent fps ratio.
I have to draw multiple layers on the same view. Layers may overlaps, but not always.
Right now, to be able to choose which layer is on top of the others, i'm using the PolygonOffet properties, but I don't like it.
Here is what I want to try :
-put a clear node on my root to clear all the buffers
-put a clear node on top of each layer node to clear only the depth buffer
-find a way to force OSG to draw those layer in a specific order
So my question is :
- Is it possible ?
- How can I choose the rendering order of my layer's node ?
You can clear buffers with cameras. E.g. if your main camera draws everything and you want to only clear one buffer, you can add a second camera that does nothing than just having the same renderTargetImplementation, attach the DepthBuffer to it, having the GL_DEPTH_BUFFER_BIT clearMask and let it render after your main camera.
For cameras you can choose a rendering order via setRenderOrder and for nodes you can work with setRenderBin.
If you use the multiple camera solution, you have a multipass rendering though, that may get costly, since in your case you would probably draw each layer with it's own camera.
On a sidenote, what you want is to avoid z-fighting and there are several techniques to do so. Maybe with this keyword you can find an answer.

GtkFrame mystery: Different looks each time the program is started

This is really confusing the heck out of me. Take a look at this screenshot:
Sometimes, the GtkFrames in my program look like on the left side, and sometimes they look like on the right side - or even a mix of the two! The program is exactly the same. Just running the same program multiple times yields very different looks of the GtkFrames in the program! How can that be?
It seems that there are two different designs of GtkFrame:
The first one has its label centered at the top of the frame and
smoothly dissolves towards the
bottom so that the frame doesn't completely enclose the GtkFrame's
contents.
The second design has its label left-aligned at the top of the frame
and draws a border around the complete GtkFrame.
The problem is now that GTK+ seems to choose one of the two designs entirely at random. I don't see any pattern in which design I'm going to get. It appears to happen completely at random which is really confusing me.
Can somebody shed a light onto this mystery? What is going on here? Is there a way to force GTK+ to use a certain design?
I'm using GTK+ 2.24.10 with the Adwaita theme on Linux Mint.

Resources