GithubHelp home page GithubHelp logo

Comments (9)

limbonaut avatar limbonaut commented on August 23, 2024

Unless update_mode is set to manual, BT is executed every frame. Judging by your screenshots, the PlayerInRange fails, however the MoveToPlayer for some reason is not executed? Could you provide a screenshot for it?

from limboai.

Abab-bk avatar Abab-bk commented on August 23, 2024

image
This is MoveToPlayer.

Unless update_mode is set to manual, BT is executed every frame. Judging by your screenshots, the PlayerInRange fails, however the MoveToPlayer for some reason is not executed? Could you provide a screenshot for it?除非设置为手动,否则 update_mode 每帧执行 BT。从您的屏幕截图来看,PlayerInRange 失败了,但是由于某种原因没有执行 MoveToPlayer?你能提供一张截图吗?

from limboai.

limbonaut avatar limbonaut commented on August 23, 2024

This task will do nothing, because it sets the velocity, then returns SUCCESS, which would be followed by _exit method. And _exit resets the velocity to ZERO.

Exit is always called after the task returns a SUCCESS or FAILURE.

from limboai.

Abab-bk avatar Abab-bk commented on August 23, 2024

But there is a print() in my tick function, and my Godot doesn't print anything.

from limboai.

limbonaut avatar limbonaut commented on August 23, 2024

Then it's hard to say what is going on. The code looks fine to me, besides the issue I pointed out earlier. Would you like to create a small reproduction project?

from limboai.

Abab-bk avatar Abab-bk commented on August 23, 2024

Then it's hard to say what is going on. The code looks fine to me, besides the issue I pointed out earlier. Would you like to create a small reproduction project?

achieve.zip
Here.
You need to reboot project.
AI file in Src/Scripts/AI/Tasks/Mobs.

from limboai.

Abab-bk avatar Abab-bk commented on August 23, 2024

Then it's hard to say what is going on. The code looks fine to me, besides the issue I pointed out earlier. Would you like to create a small reproduction project?

achieve.zip Here. You need to reboot project. AI file in Src/Scripts/AI/Tasks/Mobs.

Scene name: MobBase.tscn

from limboai.

limbonaut avatar limbonaut commented on August 23, 2024

Your _tick method is missing delta parameter in the MoveToPlayer task. That's why it's not showing a proper status in the debugger. Not sure why it's not printing an error when the method is called, though. Should be fixed in Godot 4.3 when proper virtual methods are implemented. Currently, GDExtension in the version 4.2 doesn't support marking methods as virtual for Godot API, so we're employing a workaround. That is why the script editor doesn't complain when you define _tick() method without a delta argument. Good news is that it will change with Godot 4.3.

To avoid such issues, I recommend using a script template: you can add it to your project with "Misc->Create script template".

from limboai.

Abab-bk avatar Abab-bk commented on August 23, 2024

🤣Thx.

from limboai.

Related Issues (20)

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.