- 听众
- 收听
- 积分
- 4580
- 主题
- 回帖
- 0
- 精华
注册时间2009-1-16
最后登录1970-1-1
该用户从未签到
|
赛盟真的是越来越没人了
发布一张地图都没人鸟,哎、、、
今天兴起,深刻地去理解了map里的代码
现在已经可以手写敲代码编辑一张地图了
首先,大家要知道rmf是VHE的项目文件
map是CS的地图源文件,VHE也可以打开它,但是它的实质是一些代码
bsp是我们的地图文件,它由map经编译程序编译得到
今天我就讲讲map文件的代码的具体意思
下面是一个最简单的地图,相信每个地图制作者都做过
它包含6个固体组合包住整个地图
一个出生点、一个点光源、一个门
- {
- "classname" "worldspawn"
- "MaxRange" "4096"
- "mapversion" "220"
- "wad" "\cs1.6\cs\valve\halflife.wad;"
- {
- ( 0 0 256 ) ( 0 512 256 ) ( 512 512 256 ) -2BABFL [ 1 0 0 13 ] [ 0 -1 0 14 ] 0 2 2
- ( 0 512 224 ) ( 0 512 256 ) ( 0 0 256 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 -96 ] 0 1 1
- ( 512 0 224 ) ( 512 0 256 ) ( 512 512 256 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 -96 ] 0 1 1
- ( 512 512 224 ) ( 512 512 256 ) ( 0 512 256 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 0 0 224 ) ( 0 0 256 ) ( 512 0 256 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 0 512 224 ) ( 0 0 224 ) ( 512 0 224 ) -2BABFL [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
- }
- {
- ( 0 0 224 ) ( 0 0 0 ) ( 0 512 0 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 -96 ] 0 1 1
- ( 0 512 224 ) ( 0 512 0 ) ( 32 512 0 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 32 0 0 ) ( 0 0 0 ) ( 0 0 224 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 0 512 0 ) ( 0 0 0 ) ( 32 0 0 ) -2BABFL [ 1 0 0 -128 ] [ 0 -1 0 0 ] 0 1 1
- ( 0 0 224 ) ( 0 512 224 ) ( 32 512 224 ) -2BABFL [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
- ( 32 512 224 ) ( 32 512 0 ) ( 32 0 0 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
- }
- {
- ( 512 512 224 ) ( 512 512 0 ) ( 512 0 0 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 -96 ] 0 1 1
- ( 480 512 0 ) ( 512 512 0 ) ( 512 512 224 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 512 0 224 ) ( 512 0 0 ) ( 480 0 0 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 480 0 0 ) ( 512 0 0 ) ( 512 512 0 ) -2BABFL [ 1 0 0 -128 ] [ 0 -1 0 0 ] 0 1 1
- ( 480 512 224 ) ( 512 512 224 ) ( 512 0 224 ) -2BABFL [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
- ( 480 0 224 ) ( 480 0 0 ) ( 480 512 0 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
- }
- {
- ( 32 512 0 ) ( 480 512 0 ) ( 480 512 224 ) -2BABFL [ 1 0 0 -128 ] [ 0 0 -1 -96 ] 0 1 1
- ( 480 512 0 ) ( 32 512 0 ) ( 32 480 0 ) -2BABFL [ 1 0 0 -128 ] [ 0 -1 0 0 ] 0 1 1
- ( 32 480 224 ) ( 32 512 224 ) ( 480 512 224 ) -2BABFL [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
- ( 32 480 0 ) ( 32 512 0 ) ( 32 512 224 ) -2BABFL [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
- ( 480 512 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 0 -1 0 0 ] 0 1 1
- }
- }
- {
- "classname" "info_player_start"
- "angles" "0 0 0"
- "origin" "256 256 128"
- }
- {
- "classname" "light"
- "_light" "255 255 255 200"
- "_fade" "1.0"
- "origin" "256 160 208"
- }
- {
- "classname" "func_door"
- "renderamt" "255"
- "rendercolor" "0 0 0"
- "angles" "0 0 0"
- "speed" "100"
- "wait" "4"
- {
- ( 320 192 96 ) ( 352 192 96 ) ( 352 160 96 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 16 ] 0 1 1
- ( 320 160 64 ) ( 352 160 64 ) ( 352 192 64 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1 0 16 ] 0 1 1
- ( 320 192 96 ) ( 320 160 96 ) ( 320 160 64 ) AAATRIGGER [ 0 1 0 -16 ] [ 0 0 -1 0 ] 0 1 1
- ( 352 192 64 ) ( 352 160 64 ) ( 352 160 96 ) AAATRIGGER [ 0 1 0 -16 ] [ 0 0 -1 0 ] 0 1 1
- ( 352 192 96 ) ( 320 192 96 ) ( 320 192 64 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
- ( 352 160 64 ) ( 320 160 64 ) ( 320 160 96 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
- }
- }
复制代码
首先,整个map由一对大括号包含
最前面有几对双引号,里面写着的是地图基本信息
这个例子的头部信息依次为:地图名、最大可视距离、地图版本、地图必要纹理
然后里面的每个大括号里的内容表示一个固体、固体实体、点实体
点实体最简单,一对大括号,里面两对双引号,分别表示该实体的“键”和“值”,其中第一行的classname是点实体类型
固体有一对大括号,里面有N行格式一致的数据,
N表示该固体有几个面,我们知道,一个固体是几个面封装起来的,所以,所有的面如果确定下来,这个固体也就确定下来了。我们都知道,两点确定一条线,三个点确定一个面,所以,每一行数据的开始都是由3个点的坐标(x,y,z)组成的,从而确定一个面。
接下来是纹理名字。
接下来两对中括号里的是纹理的坐标,每一对中括号里的数据由4个数组成前三个是起始坐标,后一个是纹理偏移量,两个坐标就可以确定一个方向,即确定了纹理的坐标和方向。
最后还有3个数字,分别表示纹理的x缩放y缩放和旋转角度
最后就是固体实体,这个最复杂,但是它的书写结构就等于“点实体”+“固体”
今天先讲解到这里,有什么建议和意见及时联系我。
QQ451089446
|
|