share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 12006 86cd92f64979
parent 12005 38563aa129c1
child 12007 ad7205e66578
equal deleted inserted replaced
12005:38563aa129c1 12006:86cd92f64979
  1125 				if landType == lfIndestructible then	specialMod = 1
  1125 				if landType == lfIndestructible then	specialMod = 1
  1126 				elseif landType == lfIce then	specialMod = 2
  1126 				elseif landType == lfIce then	specialMod = 2
  1127 				else specialMod = 0
  1127 				else specialMod = 0
  1128 				end
  1128 				end
  1129 				placedHWMapFlag[placedCount] = CGR+100+(8*specialMod)
  1129 				placedHWMapFlag[placedCount] = CGR+100+(8*specialMod)
       
  1130 			else
       
  1131 				placedType[placedCount] = "bogus"
  1130 			end
  1132 			end
  1131 		else
  1133 		else
  1132 			placedType[placedCount] = "bogus" -- we need this so we don't think we've placed a new girder and are trying to erase the things we just placed??
  1134 			placedType[placedCount] = "bogus" -- we need this so we don't think we've placed a new girder and are trying to erase the things we just placed??
  1133 			SelectClosestSprite()
  1135 			SelectClosestSprite()
  1134 			EraseClosestSprite()
  1136 			EraseClosestSprite()
  1153 				if CGR == 0 then placedHWMapFlag[placedCount] = 124
  1155 				if CGR == 0 then placedHWMapFlag[placedCount] = 124
  1154 				elseif CGR == 1 then placedHWMapFlag[placedCount] = 125
  1156 				elseif CGR == 1 then placedHWMapFlag[placedCount] = 125
  1155 				elseif CGR == 2 then placedHWMapFlag[placedCount] = 126
  1157 				elseif CGR == 2 then placedHWMapFlag[placedCount] = 126
  1156 				elseif CGR == 3 then placedHWMapFlag[placedCount] = 127
  1158 				elseif CGR == 3 then placedHWMapFlag[placedCount] = 127
  1157 				end
  1159 				end
       
  1160 			else
       
  1161 				placedType[placedCount] = "bogus"
  1158 			end
  1162 			end
  1159 		else
  1163 		else
  1160 			placedType[placedCount] = "bogus"
  1164 			placedType[placedCount] = "bogus"
  1161 			SelectClosestSprite()
  1165 			SelectClosestSprite()
  1162 			EraseClosestSprite()
  1166 			EraseClosestSprite()
  1321 
  1325 
  1322 	elseif cat[cIndex] == loc("Waypoint Mode") then
  1326 	elseif cat[cIndex] == loc("Waypoint Mode") then
  1323 
  1327 
  1324 
  1328 
  1325 		if pMode[pIndex] == loc("Delete Waypoint") then
  1329 		if pMode[pIndex] == loc("Delete Waypoint") then
       
  1330 			placedType[placedCount] = "bogus"
  1326 			EraseClosestWaypoint()
  1331 			EraseClosestWaypoint()
  1327 		else
  1332 		else
  1328 			PlaceWaypoint(x,y)
  1333 			PlaceWaypoint(x,y)
  1329 			placedCount = placedCount - 1
  1334 			placedCount = placedCount - 1
  1330 		end
  1335 		end
  1331 
  1336 
  1332 	end
  1337 	end
  1333 
  1338 
  1334 	if placementSucceeded then
  1339 	placedCount = placedCount + 1
  1335 		placedCount = placedCount + 1
       
  1336 	end
       
  1337 
       
  1338 end
  1340 end
  1339 
  1341 
  1340 -- called when user changes primary selection
  1342 -- called when user changes primary selection
  1341 -- either via up/down keys
  1343 -- either via up/down keys
  1342 -- or selecting girder/airattack
  1344 -- or selecting girder/airattack
  1529 function SaveHogData()
  1531 function SaveHogData()
  1530 
  1532 
  1531 	teamCounter = 0
  1533 	teamCounter = 0
  1532 	lastRecordedTeam = ""
  1534 	lastRecordedTeam = ""
  1533 	hhs = {}
  1535 	hhs = {}
  1534 	shoppaPointList = {}
       
  1535 	hogDataList = {}
       
  1536 	AIHogDataList = {}
       
  1537 
  1536 
  1538 	runOnHogs(GetDataForSavingHogs)
  1537 	runOnHogs(GetDataForSavingHogs)
  1539 
  1538 
  1540 	WriteLnToConsole("	------ TEAM LIST ------")
  1539 	WriteLnToConsole("	------ TEAM LIST ------")
  1541 
  1540 
  1959 -- THE BIG ONE
  1958 -- THE BIG ONE
  1960 ---------------------------------
  1959 ---------------------------------
  1961 -- saving process starts here
  1960 -- saving process starts here
  1962 -- saves all level data to logs/game0.log and generates a simple script template
  1961 -- saves all level data to logs/game0.log and generates a simple script template
  1963 function SaveLevelData()
  1962 function SaveLevelData()
       
  1963 
       
  1964 	waypointList = {}
       
  1965 	girderList = {}
       
  1966 	rubberList = {}
       
  1967 	spriteList = {}
       
  1968 	mineList = {}
       
  1969 	sMineList = {}
       
  1970 	airMineList = {}
       
  1971 	targetList = {}
       
  1972 	knifeList = {}
       
  1973 	explosivesList = {}
       
  1974 	healthCrateList = {}
       
  1975 	wepCrateList = {}
       
  1976 	utilCrateList = {}
       
  1977 	hFlagList = {}
       
  1978 	previewDataList = {}
       
  1979 	shoppaPointList = {}
       
  1980 	hogDataList = {}
       
  1981 	AIHogDataList = {}
  1964 
  1982 
  1965 	WriteLnToConsole("------ BEGIN SCRIPT ------")
  1983 	WriteLnToConsole("------ BEGIN SCRIPT ------")
  1966 	WriteLnToConsole("-- Copy and Paste this text into an empty text file, and save it as")
  1984 	WriteLnToConsole("-- Copy and Paste this text into an empty text file, and save it as")
  1967 	WriteLnToConsole("-- YOURTITLEHERE.lua, in your Data/Missions/Training/ folder.")
  1985 	WriteLnToConsole("-- YOURTITLEHERE.lua, in your Data/Missions/Training/ folder.")
  1968 
  1986