[RELEASE] Achievementsystem

04/10/2015 00:02 Dr.Sonii##136
PHP Code:
0409 21:39:07082 :: Traceback (most recent call last):

0409 21:39:07082 ::   File "game.py"line 2126in BINARY_ServerCommand_Run

0409 21
:39:07084 ::   File "stringCommander.py"line 63in Run

0409 21
:39:07086 ::   File "stringCommander.py"line 31in __call__

0409 21
:39:07087 ::   File "stringCommander.py"line 20in __call__

0409 21
:39:07089 ::   File "uiAchievement.py"line 343in HandleAchievementServerCommand

0409 21
:39:07090 :: ValueError
0409 21
:39:07090 :: : 
0409 21:39:07090 :: need more than 1 value to unpack
0409 21
:39:07090 :: 
Sagt meine Syserr.
04/16/2015 21:19 Undead Corporation#137
My problem:

locale/romania/quest/achievementsystem.lua:5: unexpected symbol near `quest'
04/24/2015 13:31 sorrellboss#138
pls help.!!!
achievementsystem_extension.lua
PHP Code:
-- Achievementsystem
-- Copyright (c2014 Yiv
-- Create2014/11/02 (YYYY/MM/DD)

achievement achievement or {}

-- 
###############################################
-- ################ CONFIGURATION ################
-- ###############################################

achievement.shop = {
    {{
19,1,10},{18,1,20},{17,1,25},{16,1,30},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
    {{
0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}},
}

-- 
A  Achievement
-- AP Achievement Points

-- Mob-Achievements          achievement.mob['VNUM'] = {{KILL_COUNTAP}}
-- 
Level-Achievements        achievement.level = {{LEVELAP}}

achievement.mob = {}
achievement.mob['L'] = {
    [
2] = {101102},
    [
21] = {101102103},
    [
41] = {101102104},
    [
51] = {101102104},
}
achievement.mob[101] = {{105}, {2510}, {5015}}
achievement.mob[102] = {{2929}}
achievement.mob[103] = {{8888}, {13371000}}
achievement.mob[104] = {{9999}, {26742000}}


achievement.level = {
    {
25},
    {
2010},
    {
4515},
    {
90020},
    {
10020},
    {
10520},
}


-- 
###############################################
-- ########## FUNCTIONS - DO NOT CHANGE ##########
-- ###############################################

--[[
achievement.init
achievement
.getNextLevelAchievementInfo
achievement
.nextLevelAchievement
achievement
.getMobAchievementInfo
achievement
.increasePoints
achievement
.getf
achievement
.setf
achievement
.login
achievement
.initLevel
achievement
.initShop
achievement
.initMob
achievement
.buyItem
achievement
.clientCommunication
]]--

achievement.init = function()
    
achievement.setf("points"0)
    
achievement.setf("level"1)
end

achievement
.getNextLevelAchievementInfo = function()
    
local n achievement.getf("level")
    if 
or table.getn(achievement.levelthen
        
return 0
    end
    
return achievement.level[n]
end

achievement
.nextLevelAchievement = function()
    
achievement.setf("level", (achievement.getf("level") + 1))
end

achievement
.getMobAchievementInfo = function(race)
    if 
achievement.mob[race] ~= nil then
        
return achievement.mob[race]
    else
        return {}
    
end
end

achievement
.increasePoints = function(points)
    
achievement.setf("points", (achievement.getf("points") + points))
end

achievement
.getf = function(flag)
    return 
pc.getf("achievement"flag)
end

achievement
.setf = function(flagvalue)
    
pc.setf("achievement"flagvalue)
    if 
flag == "points" then
        achievement
.clientCommunication("ap_info"value)
    
end
end

achievement
.login = function()
    
achievement.initLevel()
    
achievement.initShop()
end

achievement
.initLevel = function()
    
local levelAchievements ""
    
table.foreach(achievement.level,
        function(
indexlevelSet)
            
levelAchievements string.format("%s,%d_%d"levelAchievementslevelSet[1], levelSet[2])
        
end
    
)
    
levelAchievements string.sub(levelAchievements2)
    
achievement.clientCommunication("init_level"pc.get_level(), levelAchievements)
end

achievement
.initShop = function()
    
local siVnum ""
    
local siCount ""
    
local siPrice ""
    
table.foreach(achievement.shop,
        function(
tIndextSet)
            
table.foreach(tSet,
                function(
indexset)
                    
siVnum string.format("%s;%d"siVnumset[1])
                    
siCount string.format("%s;%d"siCountset[2])
                    
siPrice string.format("%s;%d"siPriceset[3])
                
end
            
)
        
end
    
)
    
siVnum string.sub(siVnum2)
    
siCount string.sub(siCount2)
    
siPrice string.sub(siPrice2)
    
achievement.clientCommunication("shop""c")
    
achievement.clientCommunication("shop""vnum"siVnum)
    
achievement.clientCommunication("shop""count"siCount)
    
achievement.clientCommunication("shop""price"siPrice)
    
achievement.clientCommunication("shop""b")
    
achievement.clientCommunication("ap_info"achievement.getf("points"))
end

achievement
.initMob = function()
    
local mobAchievements ""
    
local mobIdxTab achievement.mob['L'][pc.get_map_index()]
    if 
mobIdxTab ~= nil then
        table
.foreach(mobIdxTab,
            function(
indexvalue)
                
local mobInfoTab achievement.getMobAchievementInfo(value)
                
local mobAchievementsSUB ""
                
if mobInfoTab ~= nil then
                    table
.foreach(mobInfoTab,
                        function(
idxinfoSet)
                            
mobAchievementsSUB string.format("%s;%d"mobAchievementsSUBinfoSet[1])
                        
end
                    
)
                    
mobAchievementsSUB string.sub(mobAchievementsSUB2)
                    
mobAchievementsSUB string.format("%d_%d_%s"valueachievement.getf(string.format("npc_kills_%d"value)), mobAchievementsSUB)
                
end
                mobAchievements 
string.format("%s,%s"mobAchievementsmobAchievementsSUB)
            
end
        
)
    
end
    mobAchievements 
string.sub(mobAchievements2)
    
achievement.clientCommunication("init_mob"mobAchievements)
end

achievement
.buyItem = function(pos)
    
pos pos 1
    local row 
1
    
while pos do
        
row row 1
        pos 
pos 8
    end
    local itemSet 
achievement.shop[row][pos]
    
local ap achievement.getf("points")
    if 
ap >= itemSet[3then
        ap 
ap itemSet[3]
        
achievement.setf("points"ap)
        
pc.give_item2(itemSet[1], itemSet[2])
        
achievement.clientCommunication("ap_info"ap)
    else
        
syschat("Du hast nicht genügend Achievement-Punkte um diesen Gegenstand zu kaufen.")
    
end
end

achievement
.clientCommunication = function(param, ...)
    
local strCmd string.format("achievement %s#"param)
    if 
not arg or table.getn(arg) < 1 then return end
    local i
,1,table.getn(arg)
    while 
<= do
        
strCmd string.format(strCmd.."%s|"tostring(arg[i]))
        
1
    end
    strCmd 
string.sub(strCmd1, (string.len(strCmd) - 1))
    
cmdchat(strCmd)
end 
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
05/03/2015 18:19 serkan644#139
Bei mir kann man die Aufgaben auch nicht sehn obwohl sie eingetragen sind..

woran kann es liegen ..
05/03/2015 18:43 Yiv#140
Ihr müsst auf der jeweiligen Map sein, die in achievement.mob['L'] als Key (vorne, das vor dem = in []) eingetragen ist.

MfG
05/09/2015 19:27 sorrellboss#141
Ich beschloß Anforderungen.
Danke!

Ich lief diese Quest
PHP Code:
quest achievement_coupons begin
    state start begin
        when 30093.
use or 30094.use or 30095.use or 30096.use begin
            item
.remove()
            
local points = ({
                [
30093] = 25,
                [
30094] = 50,
                [
30095] = 100,
                [
30096] = 200
            
})[item.get_vnum()]
            
achievement.increasePoints(points)
        
end
    end
end 
und wenn ich legte es nicht auf dem offenen Posten. Sie wissen, warum?
05/09/2015 19:42 rollback#142
Quote:
Originally Posted by sorrellboss View Post
Ich beschloß Anforderungen.
Danke!

Ich lief diese Quest
PHP Code:
quest achievement_coupons begin
    state start begin
        when 30093.
use or 30094.use or 30095.use or 30096.use begin
            item
.remove()
            
local points = ({
                [
30093] = 25,
                [
30094] = 50,
                [
30095] = 100,
                [
30096] = 200
            
})[item.get_vnum()]
            
achievement.increasePoints(points)
        
end
    end
end 
und wenn ich legte es nicht auf dem offenen Posten. Sie wissen, warum?
it doesnt work because you remove the item and then try to use item.get_vnum(), which doesnt work when you removed the item.

please dont use google translate to german ... just translate to english

Code:
quest achievement_coupons begin 
    state start begin 
        when 30093.use or 30094.use or 30095.use or 30096.use begin 
            local points = ({ 
                [30093] = 25, 
                [30094] = 50, 
                [30095] = 100, 
                [30096] = 200 
            })[item.get_vnum()] 
            achievement.increasePoints(points) 
            item.remove() 
        end 
    end 
end
07/21/2015 05:52 KissMeAss#143
Bitte helfen!
Quote:
0721 05:49:22489 :: Failed to load script file : yiv work/uiscript/achievementWindow.py
0721 05:49:22489 :: error : No file or directory
0721 05:49:22524 ::
ui.py(line:2751) LoadScriptFile
system.py(line:192) execfile
system.py(line:161) Run
system.py(line:176) __LoadTextFile__
system.py(line:61) __init__

LoadScriptFile1 - exceptions.IOError:No file or directory

0721 05:49:22524 :: ================================================== ================================================== ========
0721 05:49:22524 :: Abort!!!!


0721 05:49:22526 ::
uiAchievement.py(line:244) __init__
ui.py(line:2757) LoadScriptFile
exception.py(line:36) Abort

AchievementBoard.__init__ - exceptions.SystemExit:

0721 05:49:22526 :: ================================================== ================================================== ========
0721 05:49:22526 :: Abort!!!!
07/21/2015 08:55 Yiv#144
Die achievementWindow.py liegt im falschen Verzeichnis. Bitte prüfe, ob sie in yiv work/uiscript/ liegt.

MfG
07/21/2015 15:40 KissMeAss#145
1. [Only registered and activated users can see links. Click Here To Register...]
2. [Only registered and activated users can see links. Click Here To Register...]
Funktioniert nicht.
Irgendwie anders?
07/21/2015 16:11 Yiv#146
Bleibt es der gleiche Fehler?

MfG
07/21/2015 16:30 KissMeAss#147
Ja.
@Yiv - Do you speak english?
07/21/2015 16:41 Yiv#148
Versuche mal, dieses Archiv in den "pack"-Ordner zu packen (nicht den Eintrag in der "Index"-Datei vergessen!): [Only registered and activated users can see links. Click Here To Register...]

MfG
07/21/2015 16:56 KissMeAss#149
Etwas funktioniert, aber ...
Quote:
0721 16:56:26378 :: Traceback (most recent call last):

0721 16:56:26378 :: File "networkModule.py", line 239, in SetGamePhase

0721 16:56:26378 :: File "game.py", line 128, in __init__

0721 16:56:26379 :: File "game.py", line 1818, in __ServerCommand_Build

0721 16:56:26379 :: AttributeError
0721 16:56:26379 :: :
0721 16:56:26379 :: 'GameWindow' object has no attribute 'cqcStart'
0721 16:56:26379 ::
07/22/2015 19:57 goinpeace#150