Ru/Creating a Portal 2 Coop Map: Difference between revisions

From Valve Developer Community
< Ru
Jump to navigation Jump to search
mNo edit summary
(Создание заготовки для перевода)
Line 15: Line 15:


Вот и всё! Посмотрите [[Testing Portal 2 Co-Op Maps Alone:ru|Как протестировать кооп карту в одиночку]], если у вас нету напарника.  (Чтобы протестировать карту с напарником, вы должны дать ему карту в формате .bsp, и если вы являетесь сервером, то воспользуйтесь командой changelevel для смены карты.)
Вот и всё! Посмотрите [[Testing Portal 2 Co-Op Maps Alone:ru|Как протестировать кооп карту в одиночку]], если у вас нету напарника.  (Чтобы протестировать карту с напарником, вы должны дать ему карту в формате .bsp, и если вы являетесь сервером, то воспользуйтесь командой changelevel для смены карты.)
=Co-op Level without spawn Instances=
To create a co-op level, you need to use:
* a [[logic_auto]]
* '''TWO''' [[logic_relay]]s
*a [[logic_coop_manager]]
* '''TWO''' [[logic_script]]s
* '''TWO''' [[prop_indicator_panel]]s
* a [[prop_button]]


[[Category:Portal 2 Level Design]]
{{Note| You must '''HIDE''' the [[prop_indicator_panel]] and the [[prop_button]] so the player's won't see it in the level}}
== Step 2==
* Name your first [[logic_relay]] '''relay_return_hub'''
* Name your second [[logic_relay]] '''@relay_has_new_taunt'''
* Name your [[logic_coop_manager]] '''coopmanage_return_hub'''
* Name your first [[logic_script]] '''script_return_hub'''
* Name your second [[logic_script]] '''@script_mp_coop_lobby'''
* Name your first [[prop_indicator_panel]] '''panel_level_return_orange'''
* Name your first [[prop_indicator_panel]] '''panel_level_return_blue'''
{{Note| The [[prop_button]] doesn't need a name}}
 
==Step 3: Properties==
1. Go to '''script_return_hub''' properties and do the following:
 
::{| class=standard-table
!  Property Name || Value
|-
| Name || script_return_hub
|-
| Entity Scripts || debug_scripts/mp_coop_transition_list.nut
|}
 
 
2. Now go to the '''@script_mp_coop_lobby''' properties and do this:
 
::{| class=standard-table
!  Property Name || Value
|-
| Name || @script_mp_coop_lobby
|-
| Entity Scripts || debug_scripts/mp_coop_lobby.nut
|}
 
3. Continue to the '''panel_level_return_orange''' properties:
::{| class=standard-table
!  Property Name || Value
|-
| Name || panel_level_return_orange
|-
| Time Duration || 3
|-
| Is a timer? || Yes
|-
| Indicator lights || tex_level_return_orange
|}
 
 
{{Warning|The '''panel_return_blue''' has the '''SAME''' properties except of the "Indicator lights" which is "tex_level_return_blue"}}
 
4. '''prop_button''' properties:
 
::{| class=standard-table
!  Property Name || Value
|-
| Delay Before Reset || 3
|}
 
==Step 4: Outputs/Inputs==
Now we need to connect all these entities together. Follow these instructions:
 
*'''logic_auto Outputs'''
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnMapSpawn  || @script_mp_coop_lobby || RunScriptCode || CheckForNewTaunts() || 2.00 || No
|-
| [[Image:Io11.png]] || OnMapSpawn  || script_return_hub || RunScriptCode || MapPostLoaded() || 2.00 || Yes
|-
| [[Image:Io11.png]] || OnMapSpawn  || script_return_hub || RunScriptCode || SetMapBranchAndLevel() || 0.25 || Yes
|}
{{Note| Don't forget the '''"Delays"''' and the '''"Only Once"'''}}
 
 
*'''logic_coop_manager Outputs'''
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnChangeToAllTrue  || relay_return_hub || Trigger || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnChangeToAllTrue  || panel_level_return_orange || Check || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnChangeToAllTrue  || panel_level_return_blue || Check || <none> || 0.00 || No
|}
 
*'''relay_return_hub Outputs'''
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnTrigger  || script_return_hub || RunScriptCode || ReturnToHubFromLevel() || 1.00 || Yes
|}
 
 
*'''@relay_has_new_taunt Outputs'''
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnTrigger  || brush_new_taunts || Enable || <none> || 0.00 || Yes
|}
 
 
*'''prop_button Outputs'''
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnButtonReset  || panel_level_return_orange || Stop || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnButtonReset  || coopmanage_return_hub || SetStateBFalse || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnPressed  || panel_level_return_orange || Start || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnPressed  || coopmanage_return_hub || SetStateBTrue || <none> || 0.00 || No
|}
 
 
 
That's it! You now can create co-op maps with working co-op scripting!
 
[[Category:Portal 2 Level Design:ru]]

Revision as of 08:31, 20 December 2013

Template:Otherlang2 Это основные этапы, необходимые для создания кооперативной карты:

  • Создайте энтити func_instance. В поле "VMF filename" нужно прописать путь к комнате респавна, а тоесть instances/coop/coop_spawn_room.vmf. В этом VMF файле уже есть info_player_start, а значит ненадо ставить самому.
  • Создайте другой func_instance, укажите в нём путь к комнате конца, instances/coop/coop_endlevel_room.vmf.
  • Стройте свою карту между двумя этими комнатами. (Потом просто соедените их.) Возможно вам придётся поместить всю карту в комнату (можно чёрную, или скайбокс), чтобы избежать утечек (дыры в картах)
  • Сохраните свою карту с обязательым префиксом mp_coop_.

Вот и всё! Посмотрите Как протестировать кооп карту в одиночку, если у вас нету напарника. (Чтобы протестировать карту с напарником, вы должны дать ему карту в формате .bsp, и если вы являетесь сервером, то воспользуйтесь командой changelevel для смены карты.)

Co-op Level without spawn Instances

To create a co-op level, you need to use:

Note.pngПримечание: You must HIDE the prop_indicator_panel and the prop_button so the player's won't see it in the level

Step 2

Note.pngПримечание: The prop_button doesn't need a name

Step 3: Properties

1. Go to script_return_hub properties and do the following:

Property Name Value
Name script_return_hub
Entity Scripts debug_scripts/mp_coop_transition_list.nut


2. Now go to the @script_mp_coop_lobby properties and do this:

Property Name Value
Name @script_mp_coop_lobby
Entity Scripts debug_scripts/mp_coop_lobby.nut

3. Continue to the panel_level_return_orange properties:

Property Name Value
Name panel_level_return_orange
Time Duration 3
Is a timer? Yes
Indicator lights tex_level_return_orange


Warning.pngПредупреждение:The panel_return_blue has the SAME properties except of the "Indicator lights" which is "tex_level_return_blue"

4. prop_button properties:

Property Name Value
Delay Before Reset 3

Step 4: Outputs/Inputs

Now we need to connect all these entities together. Follow these instructions:

  • logic_auto Outputs
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn @script_mp_coop_lobby RunScriptCode CheckForNewTaunts() 2.00 No
Io11.png OnMapSpawn script_return_hub RunScriptCode MapPostLoaded() 2.00 Yes
Io11.png OnMapSpawn script_return_hub RunScriptCode SetMapBranchAndLevel() 0.25 Yes
Note.pngПримечание: Don't forget the "Delays" and the "Only Once"


  • logic_coop_manager Outputs
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnChangeToAllTrue relay_return_hub Trigger <none> 0.00 No
Io11.png OnChangeToAllTrue panel_level_return_orange Check <none> 0.00 No
Io11.png OnChangeToAllTrue panel_level_return_blue Check <none> 0.00 No
  • relay_return_hub Outputs
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger script_return_hub RunScriptCode ReturnToHubFromLevel() 1.00 Yes


  • @relay_has_new_taunt Outputs
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger brush_new_taunts Enable <none> 0.00 Yes


  • prop_button Outputs
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnButtonReset panel_level_return_orange Stop <none> 0.00 No
Io11.png OnButtonReset coopmanage_return_hub SetStateBFalse <none> 0.00 No
Io11.png OnPressed panel_level_return_orange Start <none> 0.00 No
Io11.png OnPressed coopmanage_return_hub SetStateBTrue <none> 0.00 No


That's it! You now can create co-op maps with working co-op scripting!