In a Survival game player needs to find food, water and shelter in order to survive. Each Survival parameter (Hunger, Thirst, Tiredness) gradually increases until it reaches 100 %. If two or more Survival parameters have reached 100 %, player starts losing HP. Player's actions affect the increase speed of Survival parameters. Hunger and Thirst increase faster if player carries more weapons. Tiredness increases faster if player is running or holding a weapon or a flashlight. Survival parameters can be decreased by collecting the Survival items (Food, Drink, Adrenaline) and reset by reaching certain zones (Rest Zone resets Tiredness and Water Zone resets Thirst).
Video of the script so far:
https://www.youtube.com/watch?v=9OaPrJ31AeI
Basic script (Hunger, Thirst and Tiredness) is published in the Game Creators Asset Store (Version 1.131, 13.10.2016):
https://en.tgcstore.net/product/26905
Modified gamedata.lua
To save the Survival status (collected Survival items) properly, replace your titlesbank\gamedaa.lua with this file. It's recommend to backup the original file before you do it. If you are using the Quest script, comment out lines 18-29:
-- Gamedata.lua. Edits by Moshroom 13.10.2016
-- This is an edited versio of the gamedata.lua file of GameGuru version 1.131. This enables
-- saving of the tables of my RPG and Survival scripts and therefore makes them compatible
-- with the official Save Game/Load Game system.
-- Define RPG and Quest tables for save/load system
InvItem = {}
InvWeapon = {}
InvArmor = {}
InvAccessory = {}
Counter = {}
DCounter = {}
QCounter = {}
HP = {}
-- Commen out these lines if you have Quest scripts active, so the gamedata.lua won't return error
QQuantity = {}
QProgress = {}
QCountable = {}
QRequest = {}
QRequest_Get = {}
QRequest_Carry = {}
QRequest_Bribe = {}
QRequest_KillCreature = {}
QRequest_KillCharacter = {}
QRequest_KillZombie = {}
QRequest_KillSoldier = {}
QRequest_Destroy = {}
local gamedata = {}
-- Define RPG Globals
NUM_INV = 14
NUM_COUNTERS = 9999
function gamedata.save(slotnumber,uniquename)
-- save slot file
file = io.open("savegames\\gameslot" .. slotnumber .. ".dat", "w")
io.output(file)
-- header for game ID
io.write(123 .. "\n")
io.write(g_iGameNameNumber .. "\n")
io.write(uniquename .. "\n")
io.write(g_LevelFilename .. "\n")
io.write(0 .. "\n")
-- player stats
io.write("g_PlayerPosX=" .. g_PlayerPosX .. "\n")
io.write("g_PlayerPosY=" .. g_PlayerPosY .. "\n")
io.write("g_PlayerPosZ=" .. g_PlayerPosZ .. "\n")
io.write("g_PlayerAngX=" .. g_PlayerAngX .. "\n")
io.write("g_PlayerAngY=" .. g_PlayerAngY .. "\n")
io.write("g_PlayerAngZ=" .. g_PlayerAngZ .. "\n")
io.write("g_PlayerHealth=" .. g_PlayerHealth .. "\n")
io.write("g_PlayerLives=" .. g_PlayerLives .. "\n")
io.write("g_PlayerGunName=" .. g_PlayerGunName .. "\n")
-- weapon stats
UpdateWeaponStats()
for i = 1, 10, 1 do
io.write("g_WeaponSlotGot[" .. i .. "]=" .. g_WeaponSlotGot[i] .. "\n")
end
for i = 1, 10, 1 do
io.write("g_WeaponSlotPref[" .. i .. "]=" .. g_WeaponSlotPref[i] .. "\n")
end
for i = 1, 20, 1 do
io.write("g_WeaponAmmo[" .. i .. "]=" .. g_WeaponAmmo[i] .. "\n")
end
for i = 1, 20, 1 do
io.write("g_WeaponClipAmmo[" .. i .. "]=" .. g_WeaponClipAmmo[i] .. "\n")
end
for i = 1, 100, 1 do
io.write("g_WeaponPoolAmmo[" .. i .. "]=" .. g_WeaponPoolAmmo[i] .. "\n")
end
-- entity stats
io.write("g_EntityElementMax=" .. g_EntityElementMax .. "\n")
for e = 1, g_EntityElementMax, 1 do
if g_Entity[e] ~= nil then
io.write("g_Entity[" .. e .. "]['x']=" .. g_Entity[e]['x'] .. "\n")
io.write("g_Entity[" .. e .. "]['y']=" .. g_Entity[e]['y'] .. "\n")
io.write("g_Entity[" .. e .. "]['z']=" .. g_Entity[e]['z'] .. "\n")
io.write("g_Entity[" .. e .. "]['anglex']=" .. GetEntityAngleX(e) .. "\n")
io.write("g_Entity[" .. e .. "]['angley']=" .. GetEntityAngleY(e) .. "\n")
io.write("g_Entity[" .. e .. "]['anglez']=" .. GetEntityAngleZ(e) .. "\n")
io.write("g_Entity[" .. e .. "]['active']=" .. GetEntityActive(e) .. "\n")
io.write("g_Entity[" .. e .. "]['activated']=" .. g_Entity[e]['activated'] .. "\n")
io.write("g_Entity[" .. e .. "]['collected']=" .. g_Entity[e]['collected'] .. "\n")
io.write("g_Entity[" .. e .. "]['haskey']=" .. g_Entity[e]['haskey'] .. "\n")
io.write("g_Entity[" .. e .. "]['health']=" .. g_Entity[e]['health'] .. "\n")
io.write("g_Entity[" .. e .. "]['frame']=" .. g_Entity[e]['frame'] .. "\n")
io.write("g_EntityExtra[" .. e .. "]['visible']=" .. GetEntityVisibility(e) .. "\n")
io.write("g_EntityExtra[" .. e .. "]['spawnatstart']=" .. GetEntitySpawnAtStart(e) .. "\n")
end
end
-- radarobjectives array
if radarObjectives ~= nil then
for i = 0, g_objectiveCount, 1 do
if radarObjectives[i] ~= nil then
io.write("radarObjectives[" .. i .. "]=" .. radarObjectives[i] .. "\n")
end
end
end
-- stray script created globals
for n in pairs(_G) do
if string.find(tostring(_G[n]), "function:") == nil and string.find(tostring(_G[n]), "table:") == nil then
dumpout = 1
if n == "file" then dumpout = 0 end
if n == "_G" then dumpout = 0 end
if n == "io" then dumpout = 0 end
if n == "math" then dumpout = 0 end
if string.lower(string.sub(n,1,2)) == "g_" then
if n == "g_PlayerPosX" then dumpout = 0 end
if n == "g_PlayerPosY" then dumpout = 0 end
if n == "g_PlayerPosZ" then dumpout = 0 end
if n == "g_PlayerAngX" then dumpout = 0 end
if n == "g_PlayerAngY" then dumpout = 0 end
if n == "g_PlayerAngZ" then dumpout = 0 end
if n == "g_PlayerHealth" then dumpout = 0 end
if n == "g_PlayerLives" then dumpout = 0 end
if n == "g_PlayerGunName" then dumpout = 0 end
if n == "g_EntityElementMax" then dumpout = 0 end
if n == "g_imgCursor" then dumpout = 0 end
if n == "g_imgBackdrop" then dumpout = 0 end
if n == "g_iGameNameNumber" then dumpout = 0 end
if n == "g_posAboutBackdropAngle" then dumpout = 0 end
if n == "g_imgHeading" then dumpout = 0 end
if n == "g_iGraphicChoice" then dumpout = 0 end
if n == "g_sprHeading" then dumpout = 0 end
if n == "g_strStyleFolder" then dumpout = 0 end
if n == "g_sprSlider" then dumpout = 0 end
if n == "g_sprSliderM" then dumpout = 0 end
if n == "g_sprProgressF" then dumpout = 0 end
if n == "g_sprAboutBackdrop" then dumpout = 0 end
if n == "g_strBestResolution" then dumpout = 0 end
if n == "g_sprCursor" then dumpout = 0 end
if n == "g_sprSliderS" then dumpout = 0 end
if n == "g_iLoadingCountdown" then dumpout = 0 end
if n == "g_posBackdropAngle" then dumpout = 0 end
if n == "g_sprAboutCursor" then dumpout = 0 end
if n == "g_imgAboutBackdrop" then dumpout = 0 end
if n == "g_imgAboutCursor" then dumpout = 0 end
if n == "g_sprProgressB" then dumpout = 0 end
if n == "g_imgProgressB" then dumpout = 0 end
if n == "g_sprBackdrop" then dumpout = 0 end
if n == "g_imgProgressF" then dumpout = 0 end
if n == "g_LevelFilename" then dumpout = 0 end
if n == "g_PlayerGunZoomed" then dumpout = 0 end
if n == "g_PlayerController" then dumpout = 0 end
if n == "g_iMusicChoice" then dumpout = 0 end
if n == "g_PlayerGunMode" then dumpout = 0 end
if n == "g_PlayerGunClipCount" then dumpout = 0 end
if n == "g_PlayerFlashlight" then dumpout = 0 end
if n == "g_gameloop_StartHealth" then dumpout = 0 end
if n == "g_InKey" then dumpout = 0 end
if n == "g_KeyPressA" then dumpout = 0 end
if n == "g_KeyPressR" then dumpout = 0 end
if n == "g_PlayerObjNo" then dumpout = 0 end
if n == "g_PlayerGunAmmoCount" then dumpout = 0 end
if n == "g_PlayerDeadTime" then dumpout = 0 end
if n == "g_DebugStringPeek" then dumpout = 0 end
if n == "g_KeyPressF" then dumpout = 0 end
if n == "g_MouseX" then dumpout = 0 end
if n == "g_iSoundChoice" then dumpout = 0 end
if n == "g_Scancode" then dumpout = 0 end
if n == "g_GameStateChange" then dumpout = 0 end
if n == "g_KeyPressC" then dumpout = 0 end
if n == "g_MouseWheel" then dumpout = 0 end
if n == "g_PlayerThirdPerson" then dumpout = 0 end
if n == "g_gameloop_RegenDelay" then dumpout = 0 end
if n == "g_MouseClick" then dumpout = 0 end
if n == "g_PlayerLastHitTime" then dumpout = 0 end
if n == "g_PlayerGunID" then dumpout = 0 end
if n == "g_gameloop_RegenSpeed" then dumpout = 0 end
if n == "g_KeyPressSPACE" then dumpout = 0 end
if n == "g_PlayerFOV" then dumpout = 0 end
if n == "g_Time" then dumpout = 0 end
if n == "g_gameloop_RegenRate" then dumpout = 0 end
if n == "g_KeyPressS" then dumpout = 0 end
if n == "g_PlayerGunFired" then dumpout = 0 end
if n == "g_KeyPressD" then dumpout = 0 end
if n == "g_MouseY" then dumpout = 0 end
if n == "g_KeyPressW" then dumpout = 0 end
if n == "g_TimeElapsed" then dumpout = 0 end
if n == "g_KeyPressE" then dumpout = 0 end
if n == "g_KeyPressSHIFT" then dumpout = 0 end
if n == "g_PlayerGunCount" then dumpout = 0 end
if dumpout == 1 then
if tonumber(_G[n]) ~= nil then
strType = "number"
else
strType = "string"
end
io.write("GLOBALDUMP=" .. n .. "=" .. strType .. "=" .. tostring(_G[n]) .. "\n")
end
end
end
end
-- end of file
io.close(file)
-- RPG AND QUEST ADDITIONS HERE
-- Open another file
file = io.open("savegames\\gameslot" .. slotnumber .. "b.dat", "w")
--io.output(file) -- not needed
-- Write non-globals to file
file:write(
TimeHour .. "\n" ..
TimeMinute .. "\n" ..
TimeSecond .. "\n" ..
TextSize .. "\n" ..
CursorPosition .. "\n" ..
FrontPageText .. "\n")
-- Write the inventory tables to file
for i = 1,NUM_INV do
if InvItem[i] ~= nil then
file:write(InvItem[i] .. "\n")
else
file:write("0\n")
end
end
for i = 1,NUM_INV do
if InvWeapon[i] ~= nil then
file:write(InvWeapon[i] .. "\n")
else
file:write("0\n")
end
end
for i = 1,NUM_INV do
if InvArmor[i] ~= nil then
file:write(InvArmor[i] .. "\n")
else
file:write("0\n")
end
end
for i = 1,NUM_INV do
if InvAccessory[i] ~= nil then
file:write(InvAccessory[i] .. "\n")
else
file:write("0\n")
end
end -- end for
-- Write the Counter table to file
for i = 1,NUM_COUNTERS do
if Counter[i] ~= nil then
file:write(Counter[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the DCounter table to file
for i = 1,NUM_COUNTERS do
if DCounter[i] ~= nil then
file:write(DCounter[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the QCounter table to file
for i = 1,NUM_COUNTERS do
if QCounter[i] ~= nil then
file:write(QCounter[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if HP[i] ~= nil then
file:write(HP[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QQuantity[i] ~= nil then
file:write(QQuantity[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QProgress[i] ~= nil then
file:write(QProgress[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QCountable[i] ~= nil then
file:write(QCountable[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest[i] ~= nil then
file:write(QRequest[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_Get[i] ~= nil then
file:write(QRequest_Get[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_Carry[i] ~= nil then
file:write(QRequest_Carry[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_Bribe[i] ~= nil then
file:write(QRequest_Bribe[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_KillCreature[i] ~= nil then
file:write(QRequest_KillCreature[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_KillCharacter[i] ~= nil then
file:write(QRequest_KillCharacter[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_KillZombie[i] ~= nil then
file:write(QRequest_KillZombie[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_KillSoldier[i] ~= nil then
file:write(QRequest_KillSoldier[i] .. "\n")
else
file:write("0\n")
end
end
-- Write the HP table to file
for i = 1,NUM_COUNTERS do
if QRequest_Destroy[i] ~= nil then
file:write(QRequest_Destroy[i] .. "\n")
else
file:write("0\n")
end
end
io.close(file)
g_JustLoaded = 1
end
function gamedata.load(slotnumber)
-- load game data
successful = 0
file = io.open("savegames\\gameslot" .. slotnumber .. ".dat", "r")
if file ~= nil then
io.input(file)
-- header for game ID
iMagicNumber = tonumber(io.read())
iGameNameNumber = tonumber(io.read())
uniquename = io.read()
strLevelFilename = io.read()
iReserved = tonumber(io.read())
-- get all game data
strField = io.read()
while strField ~= nil do
-- get each data item
iDivision = string.find(strField, "=", 1)
strProperty = string.sub(strField, 1, iDivision-1)
strData = string.sub(strField, iDivision+1)
-- player stats
if string.lower(strProperty) == string.lower("g_PlayerPosX") then iPlayerPosX = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerPosY") then iPlayerPosY = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerPosZ") then iPlayerPosZ = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerAngX") then iPlayerAngX = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerAngY") then iPlayerAngY = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerAngZ") then iPlayerAngZ = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerHealth") then iPlayerHealth = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerLives") then iPlayerLives = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_PlayerGunName") then strPlayerGunName = strData end
-- weapon stats
for i = 1, 10, 1 do
if string.lower(strProperty) == string.lower("g_WeaponSlotGot[" .. i .. "]") then g_WeaponSlotGot[i] = tonumber(strData) end
end
for i = 1, 10, 1 do
if string.lower(strProperty) == string.lower("g_WeaponSlotPref[" .. i .. "]") then g_WeaponSlotPref[i] = tonumber(strData) end
end
for i = 1, 20, 1 do
if string.lower(strProperty) == string.lower("g_WeaponAmmo[" .. i .. "]") then g_WeaponAmmo[i] = tonumber(strData) end
end
for i = 1, 20, 1 do
if string.lower(strProperty) == string.lower("g_WeaponClipAmmo[" .. i .. "]") then g_WeaponClipAmmo[i] = tonumber(strData) end
end
for i = 1, 100, 1 do
if string.lower(strProperty) == string.lower("g_WeaponPoolAmmo[" .. i .. "]") then g_WeaponPoolAmmo[i] = tonumber(strData) end
end
-- entity stats
if string.lower(strProperty) == string.lower("g_EntityElementMax") then g_EntityElementMax = tonumber(strData) end
if string.lower(string.sub(strProperty,1,9)) == string.lower("g_Entity[") or string.lower(string.sub(strProperty,1,14)) == string.lower("g_EntityExtra[") then
iSubscriptEndPos = string.find(strProperty, "]", 1)
if string.lower(string.sub(strProperty,1,9)) == string.lower("g_Entity[") then
strSubscript = string.sub(strProperty,10,iSubscriptEndPos-1)
else
strSubscript = string.sub(strProperty,15,iSubscriptEndPos-1)
end
e = tonumber(strSubscript)
if g_Entity[e] ~= nil then
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['x']") then g_Entity[e]['x'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['y']") then g_Entity[e]['y'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['z']") then g_Entity[e]['z'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['anglex']") then g_Entity[e]['anglex'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['angley']") then g_Entity[e]['angley'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['anglez']") then g_Entity[e]['anglez'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['active']") then g_Entity[e]['active'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['activated']") then g_Entity[e]['activated'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['collected']") then g_Entity[e]['collected'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['haskey']") then g_Entity[e]['haskey'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['health']") then g_Entity[e]['health'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_Entity[" .. e .. "]['frame']") then g_Entity[e]['frame'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_EntityExtra[" .. e .. "]['visible']") then g_EntityExtra[e]['visible'] = tonumber(strData) end
if string.lower(strProperty) == string.lower("g_EntityExtra[" .. e .. "]['spawnatstart']") then g_EntityExtra[e]['spawnatstart'] = tonumber(strData) end
end
end
-- radarobjectives array
if radarObjectives ~= nil then
if string.lower(string.sub(strProperty,1,16)) == string.lower("radarObjectives[") then
iSubscriptEndPos = string.find(strProperty, "]", 1)
strSubscript = string.sub(strProperty,17,iSubscriptEndPos-1)
i = tonumber(strSubscript)
if radarObjectives[i] ~= nil then
if string.lower(strProperty) == string.lower("radarObjectives[" .. i .. "]") then radarObjectives[i] = tonumber(strData) end
end
end
end
-- global dump data
if string.upper(string.sub(strField,1,11)) == string.upper("GLOBALDUMP=") then
iVarNamePos = string.find(strField, "=", 12)
iVarTypePos = string.find(strField, "=", iVarNamePos+1)
local strVarName = string.sub(strField,12,iVarNamePos-1)
local strVarType = string.sub(strField,iVarNamePos+1,iVarTypePos-1)
local strVarValue = string.sub(strField,iVarTypePos+1)
if strVarName~="file" and strVarName~="_G" and strVarName~="io" and strVarName~="math" and strVarName~="arrayread" then
if strVarType == "number" then
_G[strVarName] = tonumber(strVarValue)
else
_G[strVarName] = strVarValue
end
end
end
-- next item
strField = io.read()
end
-- end of file
io.close(file)
-- RPG AND QUEST ADDITIONS HERE
local file = io.open("savegames\\gameslot" .. slotnumber .. "b.dat", "r")
-- If slotx.dat doesn't exist, return nil
if file == nil then
-- Ignore
else
-- Load and set the clock
TimeHour = file:read("*n", "*l")
TimeMinute = file:read("*n", "*l")
TimeSecond = file:read("*n", "*l")
-- Load and set the RPG menu options
TextSize = file:read("*n", "*l")
CursorPosition = file:read("*n", "*l")
FrontPageText = file:read("*n", "*l")
-- Load and set the inventory
for i = 1,NUM_INV do
InvItem[i] = file:read("*n", "*l")
end
for i = 1,NUM_INV do
InvWeapon[i] = file:read("*n", "*l")
end
for i = 1,NUM_INV do
InvArmor[i] = file:read("*n", "*l")
end
for i = 1,NUM_INV do
InvAccessory[i] = file:read("*n", "*l")
end
-- Load and set counters
for i = 1,NUM_COUNTERS do
Counter[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
DCounter[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QCounter[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
HP[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QQuantity[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QProgress[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QCountable[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_Get[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_Carry[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_Bribe[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_KillCreature[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_KillCharacter[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_KillZombie[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_KillSoldier[i] = file:read("*n", "*l")
end
for i = 1,NUM_COUNTERS do
QRequest_Destroy[i] = file:read("*n", "*l")
end
-- Reset Inventory to prevent crash
for i = 1,NUM_INV do
if InvItem[i] == 0 then
InvItem[i] = nil
end
end -- end for
end -- end if
io.close(file)
successful = 1
g_JustLoaded = 1
end
return successful
end
return gamedata
For more information (and Quest script compatible version of the gamedata.lua), please see this thread:
https://forum.game-guru.com/thread/213751