跳到主要内容
版本:未发布

PatreonRaceChallengePlugin

用于向其他玩家发起竞速挑战的插件。
附带简洁的类 TXR 风格 UI 和带 Elo 评分的排行榜。

备注

排行榜需要 PatreonHubPlugin 才能工作。

需要强制最低 CSP 版本 0.1.77 (1937),并且在 extra_cfg.yml 中设置 EnableClientMessages: trueEnableUdpClientMessages: true

请勿同时使用 RaceChallengePlugin 和 PatreonRaceChallengePlugin!

配置

extra_cfg.yml 中启用该插件

extra_cfg.yml
EnablePlugins:
- PatreonRaceChallengePlugin

参考配置

plugin_patreon_race_challenge_cfg.yml
# Set to false to disable leaderboard and ratings
EnableLeaderboard: true
# Name of leaderboard. Use this if you have multiple servers connected to the hub and want them to have different leaderboards.
# For example if you don't want traffic- and non-traffic servers to show on the same leaderboard, just use different
# leaderboard names for them.
LeaderboardName: "Default"
# Number of points players start with. Increase this to make races last longer
MaxPoints: 3000
# If the follower is closer than x meters to the leader, the follower will not lose points
LeaderNeutralDistanceMeters: 25
# If the follower is closer than x meters to the leader, the leader will lose points
LeaderLosesPointsDistanceMeters: 6
# Minimum amount of points lost on collision
MinCollisionPenaltyPoints: 30
# Maximum amount of points lost on collision
MaxCollisionPenaltyPoints: 600
# Increase this to make players lose more points on higher speed collisions
CollisionPenaltyMultiplier: 1

UI 自定义

竞速挑战的 lua 脚本位于 plugins/PatreonRaceChallengePlugin/lua/racechallenge.lua。你可以编辑此文件来更改 UI、添加 logo 等。
注意,出于安全原因,比赛逻辑在服务器端运行,无法通过此方式修改。

工作原理

你可以跟在另一辆由玩家控制的车后面,闪烁三次大灯或远光灯来发起竞速挑战。 被挑战的玩家可以打开双闪灯,或在聊天中输入 /accept 来接受挑战。如果被挑战的玩家在 10 秒内未作出回应,或两车距离过远,挑战将被取消。

双方玩家将以固定的初始分数开始比赛。领先的一方不会扣分,而后方的一方每秒都会扣分,落后越远,扣分越多。

当一方玩家的分数归零时,比赛结束。