「マップについて」の編集履歴(バックアップ)一覧はこちら
「マップについて」(2015/11/09 (月) 22:15:26) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
マップはmapsフォルダの中のvxlファイルとtxtファイルで構成される
*vxlファイル
マップ本体。
これ単体でも鯖は立てられるがスポーン位置等の設定をしたいときはtxtファイルも必要となる
*txtファイル
マップの様々な設定を記述する。
&bold(){各項目の説明}
マップ名
name = 'pinpoint'
バージョン
version = '1.0'
製作者
author = 'izzy'
マップについての説明
description = 'Small spawns that converge into a bottleneck at the center of the map.'
キャプチャ上限(config.txtのものより優先される)
cap_limit = 3
霧の色(スクリプトdynfog.py使用時)
fog = (127,127,255)
拡張設定(水ダメージ、範囲外ダメージ。スクリプトmap_extensions.py使用時)
extensions = {
'water_damage' : 100,
'boundary_damage' : {'left' : 223,
'right' : 288,
'top' : 223,
'bottom' : 288,
'damage': 25 }
}
&bold(){スポーン設定}
簡単なスクリプトで記述する
スクリプトを記述するときは先頭に以下の文を挿入する
from pyspades.constants import *
from pyspades.server import ServerConnection
-決められた一箇所にスポーンする場合の例
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
return (175, 256, 59)
if connection.team is connection.protocol.green_team:
return (347, 256, 59)
-複数の地点にスポーンする場合の例
import random
spawn_locations_blue = [
(128, 285, 56),
(138, 281, 56),
(135, 295, 56)
]
spawn_locations_green = [
(381, 298, 56),
(372, 314, 56),
(363, 299, 56)
]
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x, y, z = random.choice(spawn_locations_blue)
elif connection.team is connection.protocol.green_team:
x, y, z = random.choice(spawn_locations_green)
z -= 2.4 # magic numbers
x += 0.5
y += 0.5
if connection.protocol.map.get_z(x, y) <= z:
# allows spawning lower if the ground is destroyed
return x, y, z
else:
return x, y, connection.protocol.map.get_z(x, y)
-範囲内にランダムにスポーンする場合の例
import random
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x2 = random.randrange(256,291)
y2 = random.randrange(186,205)
z2 = 60
return (x2, y2, z2)
if connection.team is connection.protocol.green_team:
x3 = random.randrange(258,289)
y3 = random.randrange(302,316)
z3 = connection.protocol.map.get_z(x3, y3)
return (x3, y3, z3)
&bold(){arenaのスポーン設定}
arenaのスポーン設定はextensions内に記述する
複数の地点を設定する場合はspawnをspawnsに書き換え、括弧を二重にすること
extensions = {
'arena': True,
'arena_blue_spawn' : (228, 228, 53),
'arena_green_spawns' : ((228, 284, 53),(284, 228, 53)),
'arena_gates': ((224,224,53), (287,287,53), (224,287,53), (287,224,53))
}
&bold(){インテル・テント位置設定}
flagはインテル、baseはテントの位置
def get_entity_location(team, entity_id):
if entity_id == BLUE_FLAG:
return (182, 256, 57)
if entity_id == GREEN_FLAG:
return (330, 256, 54)
if entity_id == BLUE_BASE:
return (167, 256, 57)
if entity_id == GREEN_BASE:
return (362, 252, 57)
blue_intel = (100,100)
blue_cp = (50,50)
green_intel = (200,200)
green_cp = (250,250)
def get_entity_location(self,entity_id):
if entity_id == BLUE_FLAG:
return blue_intel + (self.protocol.map.get_z(*blue_intel),)
elif entity_id == BLUE_BASE:
return blue_cp + (self.protocol.map.get_z(*blue_cp),)
elif entity_id == GREEN_FLAG:
return green_intel + (self.protocol.map.get_z(*green_intel),)
elif entity_id == GREEN_BASE:
return green_cp + (self.protocol.map.get_z(*green_cp),)
def get_entity_location(team, entity_id):
if entity_id == GREEN_FLAG:
x = random.randrange(380,409)
y = random.randrange(192,260)
return (x, y, 57)
if entity_id == GREEN_BASE:
return (382, 233, 57)
if entity_id == BLUE_FLAG:
x = random.randrange(112,144)
y = random.randrange(192,260)
return (x, y, 57)
if entity_id == BLUE_BASE:
return (145, 233, 57)
マップはmapsフォルダの中のvxlファイルとtxtファイルで構成される
*vxlファイル
マップ本体。
これ単体でも鯖は立てられるがスポーン位置等の設定をしたいときはtxtファイルも必要となる
*txtファイル
マップの様々な設定を記述する。
&bold(){各項目の説明}
#region
マップ名
name = 'pinpoint'
バージョン
version = '1.0'
製作者
author = 'izzy'
マップについての説明
description = 'Small spawns that converge into a bottleneck at the center of the map.'
キャプチャ上限(config.txtのものより優先される)
cap_limit = 3
霧の色(スクリプトdynfog.py使用時)
fog = (127,127,255)
拡張設定(水ダメージ、範囲外ダメージ。スクリプトmap_extensions.py使用時)
extensions = {
'water_damage' : 100,
'boundary_damage' : {'left' : 223,
'right' : 288,
'top' : 223,
'bottom' : 288,
'damage': 25 }
}
&bold(){スポーン設定}
簡単なスクリプトで記述する
スクリプトを記述するときは先頭に以下の文を挿入する
from pyspades.constants import *
from pyspades.server import ServerConnection
-決められた一箇所にスポーンする場合の例
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
return (175, 256, 59)
if connection.team is connection.protocol.green_team:
return (347, 256, 59)
-複数の地点にスポーンする場合の例
import random
spawn_locations_blue = [
(128, 285, 56),
(138, 281, 56),
(135, 295, 56)
]
spawn_locations_green = [
(381, 298, 56),
(372, 314, 56),
(363, 299, 56)
]
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x, y, z = random.choice(spawn_locations_blue)
elif connection.team is connection.protocol.green_team:
x, y, z = random.choice(spawn_locations_green)
z -= 2.4 # magic numbers
x += 0.5
y += 0.5
if connection.protocol.map.get_z(x, y) <= z:
# allows spawning lower if the ground is destroyed
return x, y, z
else:
return x, y, connection.protocol.map.get_z(x, y)
-範囲内にランダムにスポーンする場合の例
import random
def get_spawn_location(connection):
if connection.team is connection.protocol.blue_team:
x2 = random.randrange(256,291)
y2 = random.randrange(186,205)
z2 = 60
return (x2, y2, z2)
if connection.team is connection.protocol.green_team:
x3 = random.randrange(258,289)
y3 = random.randrange(302,316)
z3 = connection.protocol.map.get_z(x3, y3)
return (x3, y3, z3)
&bold(){arenaのスポーン設定}
arenaのスポーン設定はextensions内に記述する
複数の地点を設定する場合はspawnをspawnsに書き換え、括弧を二重にすること
extensions = {
'arena': True,
'arena_blue_spawn' : (228, 228, 53),
'arena_green_spawns' : ((228, 284, 53),(284, 228, 53)),
'arena_gates': ((224,224,53), (287,287,53), (224,287,53), (287,224,53))
}
&bold(){インテル・テント位置設定}
flagはインテル、baseはテントの位置
def get_entity_location(team, entity_id):
if entity_id == BLUE_FLAG:
return (182, 256, 57)
if entity_id == GREEN_FLAG:
return (330, 256, 54)
if entity_id == BLUE_BASE:
return (167, 256, 57)
if entity_id == GREEN_BASE:
return (362, 252, 57)
blue_intel = (100,100)
blue_cp = (50,50)
green_intel = (200,200)
green_cp = (250,250)
def get_entity_location(self,entity_id):
if entity_id == BLUE_FLAG:
return blue_intel + (self.protocol.map.get_z(*blue_intel),)
elif entity_id == BLUE_BASE:
return blue_cp + (self.protocol.map.get_z(*blue_cp),)
elif entity_id == GREEN_FLAG:
return green_intel + (self.protocol.map.get_z(*green_intel),)
elif entity_id == GREEN_BASE:
return green_cp + (self.protocol.map.get_z(*green_cp),)
def get_entity_location(team, entity_id):
if entity_id == GREEN_FLAG:
x = random.randrange(380,409)
y = random.randrange(192,260)
return (x, y, 57)
if entity_id == GREEN_BASE:
return (382, 233, 57)
if entity_id == BLUE_FLAG:
x = random.randrange(112,144)
y = random.randrange(192,260)
return (x, y, 57)
if entity_id == BLUE_BASE:
return (145, 233, 57)
#endregion