Video:
[media]http://www.youtube.com/watch?v=OPEHXVt5AU0&feature=youtu.be[/media]
here is the function for the Achievement unlock it will stop your game to run it so maybe put it at the end or code around it or something, it will not work right now unless you have the steam launcher installed it will return a error unless you have it installed if you would like to get/help with SteamLauncher for Dev purposes please send me a message
for game dev put this code where you want the ach to pop-up
if lusername == null then
else
aunlock(name,p)
end
function aunlock(name,p)
if lusername == null then
else
achunlock = false
user.totalp = user.totalp + p
local save = textutils.serialize(user)
file = fs.open("SteamGames/"..lusername.."/stats","w")
file.writeLine(save)
file.close()
local a = "Achievement unlocked"
if #name > 20 then
x = #name + 2
else
x = 24
end
ani = 0
repeat
if ani == 1 then
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
elseif ani == 2 then
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,1)
write(p.."p")
term.setCursorPos(1,2)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
elseif ani == 3 then
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,1)
write(name)
term.setCursorPos(1,2)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,2)
write(p.."p")
term.setCursorPos(1,3)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
elseif ani == 4 then
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,1)
write("Achievement unlocked")
term.setCursorPos(1,2)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,2)
write(name)
term.setCursorPos(1,3)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,3)
write(p.."p")
term.setCursorPos(1,4)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
end
sleep(.1)
ani = ani + 1
until ani == 5
ani2 = 0
sleep(3)
repeat
if ani2 == 1 then
term.setCursorPos(1,4)
for i =1,x do
term.setBackgroundColor(colors.black)
write(" ")
end
term.setCursorPos(1,3)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
term.setCursorPos(1,2)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,1)
write(name)
term.setCursorPos(2,2)
write(p.."p")
elseif ani2 == 2 then
term.setCursorPos(1,3)
for i = 1,x do
term.setBackgroundColor(colors.black)
write(" ")
end
term.setCursorPos(1,2)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.lightGray)
write(" ")
end
term.setCursorPos(2,1)
write(p.."p")
elseif ani2 == 3 then
term.setCursorPos(1,2)
for i = 1,x do
term.setBackgroundColor(colors.black)
write(" ")
end
term.setCursorPos(1,1)
for i = 1,x do
term.setBackgroundColor(colors.yellow)
write(" ")
end
elseif ani2 == 4 then
term.setCursorPos(1,1)
for i =1,x do
term.setBackgroundColor(colors.black)
write(" ")
end
end
sleep(.1)
ani2 = ani2 + 1
until ani2 == 5
end
end