Starbound

Starbound

Tech Rework [1.0: Content Update]
 此主题已被置顶,因此可能具有重要性
Lo-op  [开发者] 2024 年 7 月 20 日 下午 9:43
Remap Existing Techs using this Framework Easily
To easily add your own tech to other slot, or map to different moves:
1)In the .tech file add "/tech/tr_control/single.lua" to “scripts”, or add "/tech/tr_control/double.lua" for double taps.

2)Add "key", its values can be "dir"(for each of "left" and "right") "up" "down" "jump" or "special1".

3)In the corresponding .lua file, copy this:
self.key = config.getParameter("key", "dir")
self.maxtime = config.getParameter("maxtime", 0.25)
self.result = false

to the init function.

4) Replace args.moves[SOMEKEY] with tr_on(args) if it is responsible for activating the tech.

Important: if a given args.moves[SOMEKEY] is used twice, then do:
Add "self.result = tr_on(args)";
Replace args.moves[SOMEKEY] with self.result.
Since tr_on works with delta time, and calling twice causes problems.
最后由 Lo-op 编辑于; 2024 年 7 月 22 日 上午 1:03