ゲーム

Dota 2 custom games

Dota 2 custom games を valkyr に接続する方法: ブリッジをインストールして設定し、対応するイベントとアクションを確認します。

方式
Custom game VScript (Lua)
状態
未テストのサンプル
イベント
frame ability spawn
アクション
kick restrict ban

Status: untested example. Not run (no Dota 2 Workshop Tools were available).

Scope, read first

  • Custom games only. The script runs in the server VScript VM of a custom game made with the Dota 2 Workshop Tools. Regular matchmaking games run on servers that no community operator controls, so this cannot be used for normal matches, and it must not be.
  • It reads only state the custom game's server already has and sends it to a valkyr-server the custom game author runs. Nothing runs on players' machines, and it does not interact with the game's own anti-cheat.
  • Follow the platform's rules for custom games, including whatever they say about HTTP requests and data sent to external servers.

What it does

  • every 0.1 s: a frame per living hero (position and facing; pitch 0);
  • npc_spawned for real heroes: spawn with the team;
  • dota_player_used_ability: an ability event for abilities listed in ability_ids, so valkyr-server cooldown checks apply;
  • batches to POST /v1/matches/{match_id}/events with CreateHTTPRequestScriptVM, polls GET /v1/actions and disconnects players for kick, restrict and ban.

Dota is top down: aim, view and information checks have little to work with. Useful checks are movement speed and teleports (declare hero speeds in the valkyr-server movement config, converted with 0.0254 m per unit) and ability cooldowns. Player ids are 32 bit Steam account ids.

Install

Copy scripts/vscripts/valkyr.lua into your custom game's scripts/vscripts/ and start it from addon_game_mode.lua:

LuaLua
local Valkyr = require("valkyr")function Activate()    Valkyr:Start({ url = "http://your-valkyr-host:7420", key = "ingest-key", prefix = "mygame",                   ability_ids = { my_custom_blink = 1 } })end

To verify: the JSON library available in your VScript VM, the exact dota_player_used_ability fields, and DisconnectClient.

ゲーム名とプラットフォーム名は各所有者に帰属し、互換性の説明のためにのみ使用しています。valkyr はそれらと提携していません。

GitHub でこのページを編集