Raised This Month: $32 Target: $400
 8% 

KeyValues Extension


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-31-2018 , 17:23   KeyValues Extension
Reply With Quote #1

This is not for a sourcemod plugin, but for the extension.

To be specific, I need to read the some data from the third subsection of the l4d2 mission files. Already went through KeyValues.h and couldn't find a way to jump to next section. Any help?

PHP Code:
"mission"
{
    
"Name"        "L4D2C5"
    "Version"    "1"
    "Author"    "Valve"
    "Website"    "http://store.steampowered.com"

    "DisplayTitle"    "#L4D360UI_CampaignName_C5"
    "Description"    "#L4D360UI_CampaignName_C5Objective"
    "Image"            "maps/c5"
    "OuttroImage"    "vgui/outroTitle_TheParish"

    "x360ctx"    "7"

    "meleeweapons"    "tonfa;frying_pan;machete;electric_guitar;baseball_bat;knife"

    
// Loading poster data
    
"poster"
    
{
        
"posterImage"                "LoadingScreen_TheParish"
        "posterImage_widescreen"    "LoadingScreen_TheParish_widescreen"
        
        "fullscreen"        "1"
        
        "posterTitle"        "#L4D360UI_CampaignTitle_C5"
        "posterTitle_y"        "320"
        
        "posterTagline"        "#L4D360UI_CampaignTagline_C5"
        "posterTagline_y"    "380"
        
        "l4d2_names"                "1"
        
        "gambler_player_name_x"        "9999"
        "gambler_player_name_y"        "9999"
        
        "producer_player_name_x"    "9999"        
        "producer_player_name_y"    "9999"    
        
        "coach_player_name_x"        "9999"    
        "coach_player_name_y"        "9999"    
        
        "mechanic_player_name_x"    "9999"
        "mechanic_player_name_y"    "9999"

        "character_order"        "gambler;producer;coach;mechanic"
    
}


    
"modes"
    
{
        
"coop"
        
{
            
"1"
            
{
                
"Map" "c5m1_waterfront"
                "DisplayName" "#L4D360UI_LevelName_COOP_C5M1"
                "Image" "maps/c5m1_waterfront"
                "x360ctx" "29"
            
}

            
"2"
            
{
                
"Map" "c5m2_park"
                "DisplayName" "#L4D360UI_LevelName_COOP_C5M2"
                "Image" "maps/c5m2_park"
                "x360ctx" "30"
            
}

            
"3"
            
{
                
"Map" "c5m3_cemetery"
                "DisplayName" "#L4D360UI_LevelName_COOP_C5M3"
                "Image" "maps/c5m3_cemetery"
                "x360ctx" "31"
            
}

            
"4"        
            
{
                
"Map" "c5m4_quarter"
                "DisplayName" "#L4D360UI_LevelName_COOP_C5M4"
                "Image" "maps/c5m4_quarter"
                "x360ctx" "32"
            
}

            
"5"        
            
{
                
"Map" "c5m5_bridge"
                "DisplayName" "#L4D360UI_LevelName_COOP_C5M5"
                "Image" "maps/c5m5_bridge"
                "x360ctx" "33"
            
}
        }

        
"versus"
        
{
            
"1"
            
{
                
"Map" "c5m1_waterfront"
                "DisplayName" "#L4D360UI_LevelName_VERSUS_C5M1"
                "Image" "maps/c5m1_waterfront"
                "VersusCompletionScore"    "400"
            
}

            
"2"
            
{
                
"Map" "c5m2_park"
                "DisplayName" "#L4D360UI_LevelName_VERSUS_C5M2"
                "Image" "maps/c5m2_park"
                "VersusCompletionScore"    "500"
            
}

            
"3"
            
{
                
"Map" "c5m3_cemetery"
                "DisplayName" "#L4D360UI_LevelName_VERSUS_C5M3"
                "Image" "maps/c5m3_cemetery"
                "VersusCompletionScore"    "600"
            
}

            
"4"        
            
{
                
"Map" "c5m4_quarter"
                "DisplayName" "#L4D360UI_LevelName_VERSUS_C5M4"
                "Image" "maps/c5m4_quarter"
                "VersusCompletionScore"    "700"
            
}

            
"5"        
            
{
                
"Map" "c5m5_bridge"
                "DisplayName" "#L4D360UI_LevelName_VERSUS_C5M5"
                "Image" "maps/c5m5_bridge"
                "VersusCompletionScore"    "800"
            
}
        }    
    
        
"survival"
        
{
            
"1"
            
{
                
"Map" "c5m2_park"
                "DisplayName" "#L4D360UI_LevelName_SURVIVAL_C5M2"
                "Image" "maps/c5m2_busdepot"
                "x360ctx"    "21"

                "x360leaderboard"
                
{
                    
":id"        "20"
                    "besttime"
                    
{
                        
"prop"    "536870986" // "0x2000004A"
                    
}
                }
            }

            
"2"        
            
{
                
"Map" "c5m5_bridge"
                "DisplayName" "#L4D360UI_LevelName_SURVIVAL_C5M5"
                "Image" "maps/c5m5_bridge_end"
                "x360ctx"    "22"

                "x360leaderboard"
                
{
                    
":id"        "22"
                    "besttime"
                    
{
                        
"prop"    "536870988" // "0x2000004C"
                    
}
                }
            }
        }    

        
"scavenge"
        
{
            
"1"
            
{
                
"Map" "c5m2_park"
                "DisplayName" "#L4D360UI_LevelName_SCAVENGE_C5M2"
                "Image" "maps/c5m2_park"
                "x360ctx"    "28"
            
}
        }    
    }

__________________
Spirit_12 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 01-31-2018 , 17:50   Re: KeyValues Extension
Reply With Quote #2

I'm pretty sure all the natives just map to their equivelant KeyValues object function. You can see how they're implemented yourself here: https://github.com/alliedmodders/sou..._keyvalues.cpp

The GotoNextKey native just calls GetNextKey (https://github.com/alliedmodders/sou...alues.cpp#L619)
hmmmmm is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-31-2018 , 18:21   Re: KeyValues Extension
Reply With Quote #3

Still having a hard time with it. Can anyone provide some examples?
__________________
Spirit_12 is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 01-31-2018 , 20:40   Re: KeyValues Extension
Reply With Quote #4

https://bitbucket.org/Drifter321/dot...ension.cpp-193 gl hf
Dr!fter is offline
Reply


Thread Tools
Display Modes

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 20:30.


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