GALV_maptravel研究分析(2)
本節地圖:Gov's Mansion,Campsite,Yourmansion
++++++++++++++++++++華麗麗的分割線+++++++++++++++++++++++++++++++++
1.NPC處指令碼
這裡不需要過多解釋,簡單易懂
相關程式碼:
Galv.MAPT.openMap(0); 開啟地圖
if(Galv.MAPT.mapSelevted) 進行地點選擇
{
跳轉{map ID}({x Coordinate},{y Coordinate}) 進行跳轉
}
++++++++++++++++++++華麗麗的分割線+++++++++++++++++++++++++++++++++
2.左上角處指令碼
Galv.MAPT.initLocation("Gov's Mansion");
/*Set starting location for map scene to Gov's Mansion so when player opens
the travel scene, they will start with that location selected.*/
初始場景設定
Galv.MAPT.setObject(0,"Player","obj_player",520,190,2);
/*An example of using an object to show where the player is.
I'll place it next to the above location here*/
展示玩家的位置
語法: Galv.MAPT.setObject(id,"name","image",mx,my,f);
++++++++++++++++++++華麗麗的分割線+++++++++++++++++++++++++++++++++
3.開啟之前無法到達的地圖
Galv.MAPT.enableLocation(0,"Your Mansion",true);
{回顧下如果禁止通過:Galv.MAPT.enableLocation(0,"Your Mansion",false);}
/*Example of updating a location, which default to 'enabled' so the above
script call wouldn't be needed in this particular case*/
//Galv.MAPT.setLocation(0,"Your Mansion","loc_mansion",620,440,3,8,11,"This is your 'mansion' you can get in it now!");
Galv.MAPT.editLocation(0,"Your Mansion","desc","This is your 'mansion' you can get in it now!");
語法:
Galv.MAPT.editLocation(id,"name","attribute",value); // edit location
// id = the map id you are editing
// "name" = the location name you are editing
// "attribute" = the attribute you would like to edit. This can be:自選屬性
// "image" value = "imageName" 圖片
// "mapXY" value = [x,y] 地圖
// "transfer" value = [mapid,x,y] 移動
// "desc" value = "description here" 描述
// value = the value to change to. values for each attribute are above. 值
++++++++++++++++++++華麗麗的分割線+++++++++++++++++++++++++++++++++
4.Galv.MAPT.removeLocation(0,"Gov's Mansion");
在大地圖上移除地圖