• News
  • Account
    • Subscriptions
    • Orders
    • Account Details
  • Shop
    • gw2cc Licence
    • Plugins
    • Bots
  • Support

Login

User Guide

  • Installing gw2cc
  • Update Channels
  • Using the Attach Mode
  • Activating & Deactivating Plugins
  • Plugins
    • Teleporter

Developer Guide

  • Architecture
  • Getting Started
  • Creating Plugins
  • Making your Mod able to walk
  • Distributing Plugins and Bots
  • Helpfull Topics
    • Starting with Godot
    • Coordinate System
    • Behavior Trees
View Categories
  • Home
  • Docs
  • Developer Guide
  • Making your Mod able to walk

Making your Mod able to walk

< 1 min read

To access navigation features, gw2cc offers a customized version of Godot’s NavigationServer.

Libcc provides an easy way to utilize it (libcc/navigation/NavigationMapInstance.gd). Assuming you created a new Bot using the Project->Tools->Create Mod wizard, simply add a Node3D named NavigationMapInstance to your bot scene and Drag & Drop NavigationMapInstance.gd onto it. Right click the node, select "Access as unique node". Make sure this is not the first child of your BehaviorTree! In your BehaviorTree root node add this code snipped to the _on_controlled_character_spawned function like so:

func _on_controlled_character_spawned(_cc: AgentChar) -> void:
    var path = ContentService.get_asset_dir().path_join("map").path_join(str(Manager.mission.map_def.map_file) + ".res")
    %NavigationMapInstance.map = load(path)
    %NavigationMapInstance.mesh = await %NavigationMapInstance.load_nav_for_map(Manager.mission.get_map_id(),BOT_NAME)
    _context["nav_map"] = %NavigationMapInstance.navigation_map
    _start_b_tree()
    unpause()

This would cause your bot to automagically load/create and save the generated NavigationMesh for each map at \game_data\101\BOT_NAME.

Updated on February 7, 2025
Creating PluginsDistributing Plugins and Bots
  • Impressum
  • Terms and Conditions
  • Privacy Policy
  • Refund and Returns Policy
  • Backlinks
The GW2 Custom Client