注册 | 登录

游侠NETSHOW论坛





查看: 3319|回复: 5
打印 上一主题 下一主题

[求助] COH英雄连给车辆,建筑物命令栏增加子菜单的方法 [复制链接]

帖子
652
精华
0
积分
326
金钱
1437
荣誉
0
人气
0
评议
0
跳转到指定楼层
楼主
发表于 2009-4-14 09:16:02 |只看该作者 |倒序浏览
找到了一篇外文参考.
http://forums.relicnews.com/showthread.php?t=211532
但是,由于这篇教学文章写的不够详细, 加上难懂的英文.
我并没有成功做出来.. 期待中国的高手能做出来, 并给个详细点的说明.

哪为大大帮忙翻译一下也好啊..
1. First off, create a Marker Upgrade. To make things simple, copy "allied_armor.rgd" and call it "menu_marker". This upgrade already does nothing, so you don't need to change it.

2. Next create an ability called "enter_menu". Copy an existing ability, like one of the camouflage abilities, and adjust the settings as follows:
action_list
. remove all pre-existing actions
. add in an upgrade_add action under start_self_actions
. . apply_to_entities_in_squad = false
. . put in the full path and name of the marker upgrade we created above
activation = timed
ai_tactic
. delete all fields except class_list and custom_targeting
. priority = -1
. tactic_range_override = -1
duration_time = -1
recharge_time = 0
requirements
. remove all pre-existing requirements
. add in a player_upgrade_requirement
. . is_present = false
. . reason = usage_and_display
. . put in the full path and name of the marker upgrade we created above.
ui_group_position = a slot not in use on the building
ui_info = anything you want


3. Create an ability called "exit_menu". Copy the ability we created above, except change the following:
action_list
. remove the upgrade_add action
. add in an upgrade_remove action under start_self_actions
. . put in the full path and name of the marker upgrade we created above
requirements
. change the player_upgrade_requirement as follows
. . is_present = true
ui_info = change this so that it appears different than the enter ability

If you did the steps above, and test it now, you will find a button in the building that can be clicked. Clicking it makes that button disappear, and the exit button will appear. Clicking that makes the exit button disappear, and the enter button reappear.

The AI will not use these buttons, since we set the ai_tactic priority to -1. So you don't have to worry that the AI will endlessly "click" them over and over.

4. Take all the squads, abilities, and upgrades you want to be specific to your menu, and that are accessible from that building. You will want to add a player_upgrade_requirement to these that require "menu_marker" in order for display. Then you will find all the squads, abilities, and upgrades that should not be accessible when in the menu, and give these the same player upgrade requirement, but set to FALSE, so that they require the upgrade to not be there.

The reason why we set the requirement reason to "display" instead of "usage_and_display" is so that the AI can still use them. A player can't click a button that is not being displayed, even if it can still be used, but the AI can click that hidden button. Since the AI can't enter and exit the menus, and we can't teach the AI to do so, we still need to allow for the AI to access those buttons that are otherwise hidden; hence using "display" as the reason for the player_upgrade_requirement on the sbps and upgrades we are hiding.

So now, if you test it, entering the menu makes some options appear, and some options disappear. Leaving the menu restores things to the way they were. If you enter the menu, deselect the building, and reselect it later, you will still be in the menu.

All we've done is take the standard "I need an upgrade to show up" method and applied it to making the UI change based upon user actions. The ability buttons give and take blank upgrades that do nothing on their own, and only mark what menu the player is in, so that other buttons know whether to be visible or not.


More Advanced
You can also add sub-menus to squads. If you do this, the marker upgrade must be owned by "self" rather than "player", so that it sticks to the specific squad. You also need to change the player upgrade requirements to squad upgrade requirements. Otherwise everything else remains the same.

[ 本帖最后由 jiaoxujin 于 2009-4-14 09:47 编辑 ]

使用道具 举报

帖子
15440
精华
0
积分
7836
金钱
18523
荣誉
11
人气
10
评议
0
沙发
发表于 2009-4-14 09:17:47 |只看该作者
有没有图???想知道是什么样式的………………………………

使用道具 举报

帖子
652
精华
0
积分
326
金钱
1437
荣誉
0
人气
0
评议
0
板凳
发表于 2009-4-14 09:23:55 |只看该作者
你看这里啊.
http://forums.relicnews.com/showthread.php?t=211532
没图啊. 据说这个作者有MOD, 我看看能不能先找到他的MOD

使用道具 举报

帖子
652
精华
0
积分
326
金钱
1437
荣誉
0
人气
0
评议
0
地板
发表于 2009-4-14 09:27:53 |只看该作者
我是想把 战役任务中的 Tiger 205 搞到 独立战役中去
但是战役中的技能树 我不可能搞的过去.
但是一分析, 技能树中的技能 其实也就是些升级(upgrades)
我只要把这些升级放在Tiger 205中的命令栏中去就行了. 以此对Tiger 205的技能作些限制. 只有升级才有的用.
但是命令栏格子才12个, 远远不够用, 这12个光放技能就已经满了.
所以最好是用子菜单..
当然,把这些upgrades放到一个新的建筑物里应该是可以的.
但是感觉还是放到Tiger 205自己命令栏里比较好...

使用道具 举报

帖子
652
精华
0
积分
326
金钱
1437
荣誉
0
人气
0
评议
0
5#
发表于 2009-4-14 09:29:35 |只看该作者
原帖由 红马甲 于 2009-4-14 09:17 发表
有没有图???想知道是什么样式的………………………………

就像工兵 建 建筑物那样.  点建筑物图标, 出来一个建筑物子菜单..
那个英文文章, 我理解的是这样子的:

做两个"技能",
一个叫做 Enter Menu, 另一个叫做 Exit Menu
把这两个"技能"放到 车辆命令栏中去.

Enter Menu技能调用Action:
action\ability_action\upgrade_add
把"子菜单"中的内容显示出来.
(其实并不存在真正的子菜单,  就是直接将所有的 技能/upgrades 放到车辆的abilities和upgrades里面, 而且ui_group_position 肯定都在1-12之间, 并且"子菜单"的ui_group_position与父菜单的
ui_group_position重复. 比如有24个技能, 那么这24个技能的ui_group_position 都在1-12之间, 每个都重复一次)

Exit Menu技能调用Action:
action\ability_action\upgrade_remove
把"父菜单"中的内容显示出来.

就是控制1-12个格子中的技能/upgrades 的图标的 显示与隐藏, 每个格子中可能有2个技能, 其中一个是作为"子菜单"的内容的.

原理大概是这样, 不过我没有做出来.
做了一半, 又却图标. (显示粉红)
有空再试试.

[ 本帖最后由 jiaoxujin 于 2009-4-14 09:41 编辑 ]

使用道具 举报

帖子
652
精华
0
积分
326
金钱
1437
荣誉
0
人气
0
评议
0
6#
发表于 2009-4-14 09:45:46 |只看该作者
标题写错了, 不能改吗?  

如果-->如何

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

手机版|Archiver|游侠NETSHOW论坛 ( 苏ICP备2023007791号 )

GMT+8, 2025-9-2 13:28 , Processed in 0.275674 second(s), 12 queries , Gzip On, Memcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

分享到