Raised This Month: $51 Target: $400
 12% 

*****


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Gachl
BANNED
Join Date: Feb 2009
Old 08-29-2009 , 04:48   Re: [TF2] Custom Achievements
#121

Thanks to tcviper for approving this plugin.
Gachl is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 08-29-2009 , 09:56   Re: [TF2] Custom Achievements
#122

Yea sorry Gachl I couldn't/can't get to those achievements, I'm busier than originally thought x_x
Dragonshadow is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-29-2009 , 15:17   Re: [TF2] Custom Achievements
#123

Just to say that some complications have arised with my plugin, but I will do my best to get a functional and usable version of it released as soon as I can .

I'll be testing the new code tomorrow, it should loop through the entire (newly formatted) config and award achievements for each match, so multiple achievements for the same weapons/names/IDs should be possible (IF THIS WORKS, no promises I'm afraid, but I've got high hopes)
__________________

Last edited by Jindo; 08-29-2009 at 16:05.
Jindo is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-30-2009 , 05:34   Re: [TF2] Custom Achievements
#124

I've now narrowed this plugin down to one small but very major and breaking glitch, when a death event fires, it runs through the for loop multiple times where it should only loop through it once:

PHP Code:
public Action:eCheckFile(Handle:event, const String:name[], bool:noBroadcast)
{
    
    
KvRewind(g_achievements);
    
    for (new 
1<= g_maxAchievementsi++)
    {
        
PrintToChatAll("i = %i"i); //debugger
        
new ply_id CompareConditions(ievent);
        new 
ach_id KvGetInt(g_achievements"achid");
        
KvRewind(g_achievements);
        if (
ply_id != 0)
        {
            
ProcessAchievement(ach_idply_id);
        }
    }
    return 
Plugin_Continue;

Is there anything there that could be causing this one loop to loop several times? D:
__________________
Jindo is offline
Xsinthis
Senior Member
Join Date: Oct 2008
Location: Canadia, eh?
Old 08-30-2009 , 13:26   Re: [TF2] Custom Achievements
#125

Quote:
Originally Posted by Jindo View Post
I've now narrowed this plugin down to one small but very major and breaking glitch, when a death event fires, it runs through the for loop multiple times where it should only loop through it once:
why loop at all then? Or does this code have to be looped for other parts?

EDIT: I don't know much about sourcepawn, but this looks alot like Java. In your loop, you declare i as 1, test if it is less then or equal to g_maxAchievements, with an increment to i. Where does g_maxAchievements come from?
__________________

Last edited by Xsinthis; 08-30-2009 at 13:31.
Xsinthis is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-31-2009 , 03:20   Re: [TF2] Custom Achievements
#126

Quote:
Originally Posted by Xsinthis View Post
why loop at all then? Or does this code have to be looped for other parts?
The loop is to go through each achievement in the config.

Quote:
EDIT: I don't know much about sourcepawn, but this looks alot like Java. In your loop, you declare i as 1, test if it is less then or equal to g_maxAchievements, with an increment to i. Where does g_maxAchievements come from?
g_maxAchievements is declared and defined in an earlier code, I've already debugged that part and g_maxAchievements is giving the right number, which is why I moved on to this part.

What should happen is that when someone dies, the code loops through the config file once to check which achievements match the conditions, but for some reason the loop happens multiple times (3-4) after a single death.
__________________
Jindo is offline
SuperShadow
SourceMod Donor
Join Date: Jun 2008
Location: Westminster, MD
Old 08-31-2009 , 07:42   Re: [TF2] Custom Achievements
#127

Are you sure it's only being called once? You might have a better chance of getting an answer in the scripting section.
SuperShadow is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-31-2009 , 18:28   Re: [TF2] Custom Achievements
#128

Posted the thread, and just now I managed to fix it, the event was only called once, the problem for some reason was removed by changing some variables which were completely irrelevant to the event hooking...

I'll do some more tests on the plugin and have it uploaded sometime tomorrow, assuming all is well!

Example of the new config's layout:

Code:
"killtypes"
{
    "1"
    {
        "achid"                    "1"
        "weapon_eq"                "flaregun"
    }
    "2"
    {
        "achid"                    "2"
        "weapon_eq"                "flaregun"
        "victim_name_con"        "-KJ-"
    }
    "3"
    {
        "killer_name_con"        "Jindo"
        "achid"                    "3"
    }
    "4"
    {
        "killer_id_eq"            "STEAM_0:0:1234"
        "target"                "1"
        "achid"                    "4"
    }
}
__________________

Last edited by Jindo; 08-31-2009 at 18:31.
Jindo is offline
Sexual Harassment Panda
Veteran Member
Join Date: Dec 2008
Location: San Diego, CA
Old 08-31-2009 , 22:29   Re: [TF2] Custom Achievements
#129

Wow Thanks jindo, This will make everything much easier for everybody. Huge props to you. I'm excited. +karma
__________________
Sexual Harassment Panda is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 09-01-2009 , 05:31   Re: [TF2] Custom Achievements
#130

Good news: the plugin appears to be working 100%, the debugger adjustment shows that I'm getting the right achievements under the right conditions, go me!

I'll rework the plugin to use the Custom Achievements native and upload it for testing + public use, along with a quick read me on what to do with the config file.
__________________
Jindo is offline
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode