- UID
- 2395094
- 主题
- 0
- 阅读权限
- 30
- 帖子
- 652
- 精华
- 0
- 积分
- 326
- 金钱
- 1437
- 荣誉
- 0
- 人气
- 0
- 在线时间
- 180 小时
- 评议
- 0
- 帖子
- 652
- 精华
- 0
- 积分
- 326
- 金钱
- 1437
- 荣誉
- 0
- 人气
- 0
- 评议
- 0
|
找到了一篇外文参考.
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 编辑 ] |
|