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

[ANY] tLevelMod v0.1.3 (2010-04-05)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-14-2010 , 18:36   [ANY] tLevelMod v0.1.3 (2010-04-05)
Reply With Quote #1

This is a modular and therefore multi-part plugin, providing a basic backend for a RPG-like gameplay modification. Credits to noodleboy for inspiring me to do this.

Currently this only has an interface for l4d2 and tf2.

And it is -at the moment- only cosmetic (again credits to noodleboy, his original plugin can be found here) although a tf2 attribute plugin is on its way, the source to a pre-alpha-git version can be found here.

A complete description, install instuctions, the latest version, changelog (rss) and a development guide can be found on its github page.
If you are interested in contributing to this project, send me a pm.

Taken from the wiki on github:
Quote:
This is a modular SourceMod Plugin providing a basic backend for RPG-like gameplay modifications. It uses and can interact with multiple plugins to achieve a fully fledged rpg experience in source engine based games.

If you are a developer and want to use the levelmod includes and see some basic examples, read Development.
If you are a hosting your own gameserver and want your players to have some leveling fun while playing on your server, read Installation.

Please note that this plugin is in a very early stage, not fully tested and might crash your server. If you still feel experimental enough to install this on your server, please report any issues either here or in the issues tab over at github.

Additionally you might want to check-out tAttributes, another SourceMod Plugin currently in development, which provides gameplay benefits for leveling up – currently only for Team Fortress 2, but this limitation will certainly change in the future…
About the currently existing parts:
Quote:
levelmod.core
The backend. This is essential. All following plugins interface with the core.

levelmod.cmds
Gives admins the following commands:
sm_lm_setlevel <OPT:target> <level>
sm_lm_givexp <OPT:target> <amount>
sm_lm_showlist

levelmod.log
Uses loghelper.inc to log “levelmod_levelup” events. This is useful if you host your own HLStatsX Community Edition Server and want to log level ups.

levelmod.permanent.clientprefs
Uses clientprefs to save xp points. Install this if you want your clients to keep their XP points after disconnecting or level transition. You must have clientprefs activated and configured on your server.

levelmod.xp.tf2
Gives clients xp for capping points, healing, winning a round etc

levelmod.xp.hurt.sdkhooks
Gives clients xp for damaging other players. Uses sdkhooks.

levelmod.xp.l4d2
Gives clients xp for killing infected, winning a versus etc

levelmod.xp.kill
Gives clients xp for killing other players

levelmod.hud.tf2
Provides a hud for tf2. Credits to noodleboy for making this.

levelmod.hud.l4d2.hint
No fancy stuff, just basic hint messages informing players of their level, xp and when they level up etc.
If you are running l4d2, you want this.

levelmod.ranks
Provides names to levels. Current rank names are taken from [TF2] Cosmetic Class Experience, but are saved in a cvar and therefore easily editable. Credits to Mecha the Slag for providing the idea and the list.

levelmod.gamedescription
Uses SDKHooks to change the game's description to tLevelMod
2010-04-05: Again Updated for compatibility with tAttributes. Contains many fixes. Full list here.
Attached Files
File Type: inc levelmod.inc (3.2 KB, 801 views)
File Type: sp Get Plugin or Get Source (levelmod.core.sp - 1854 views - 10.8 KB)
File Type: zip levelmod_r05.zip (83.3 KB, 1273 views)

Last edited by Thrawn2; 04-05-2010 at 07:51.
Thrawn2 is offline
kiraibrasil
Member
Join Date: Jun 2009
Old 03-14-2010 , 18:40   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #2

Work in l4d2?
kiraibrasil is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-14-2010 , 18:41   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #3

Quote:
Not for "productive" usage, blocks using any menus.
not yet. have to change usage of panels to user messages or stuff. i've never coded for l4d2 before.
Thrawn2 is offline
kiraibrasil
Member
Join Date: Jun 2009
Old 03-14-2010 , 18:45   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #4

The additional benefit to having a level higher
kiraibrasil is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-14-2010 , 19:03   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #5

so far none. benefits will be provided by plugins interacting with tLevelmod.
Thrawn2 is offline
deltadude
SourceMod Donor
Join Date: Mar 2010
Old 03-15-2010 , 16:10   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #6

ok i get it to load up
cept the menu keeps popping up after we close it saying Level 0/100 and i press 1 it disapears comes bak couple seconds later which prevents pple from changing ur weapons any way to disable it?

Last edited by deltadude; 03-15-2010 at 16:21.
deltadude is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-15-2010 , 18:26   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #7

what game, l4d2 or tf2?
did you set it up according to this guide?
Thrawn2 is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-15-2010 , 19:28   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #8

nevermind, get the latest version, it _should_ work out of the box for both games.
the l4d2 hud version should work for any game supporting hintmessages in a fashionable way, i'll have to test this.
Thrawn2 is offline
PMAvers
Member
Join Date: Sep 2009
Old 03-17-2010 , 11:06   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #9

Been running it for a few days, and it hasn't crashed the server yet or anything, so that's good.

For some reason, levels for players (other than bots) don't seem to be saving, so if you disconnect and reconnect, you'll be back at Level 0. Maybe I missed a cvar somewhere. (And yeah, Clientprefs *is* installed.)
PMAvers is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-17-2010 , 13:19   Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
Reply With Quote #10

Quote:
For some reason, levels for players (other than bots) don't seem to be saving, so if you disconnect and reconnect, you'll be back at Level 0. Maybe I missed a cvar somewhere. (And yeah, Clientprefs *is* installed.)
huhm, thats weird. can't reproduce this.
does your serverlog say sth like this when a player connects:
DB: <playername> has xp: <value>
and is xp > 0 ?
your clientprefs db is configured correctly? is there a clientprefs-sqlite.sq3 in your sourcemod/data/sqlite folder? are you using mysql as a clientprefs backend?
or am i having some race condition in my code - when i think about it, this could be the case.

Maybe some one else can help as i am no expert for clientprefs:
PHP Code:
public OnPluginStart()
{
    
db_level RegClientCookie("levelmod_level""Current player level"CookieAccess_Private);
    
db_xp RegClientCookie("levelmod_xp""Current player experience points"CookieAccess_Private);
}


/////////////////////////
//L O A D  F R O M  D B//
/////////////////////////
public OnClientCookiesCached(client) {
    
loadValues(client);
}

stock loadValues(client) {
    if (!
AreClientCookiesCached(client))
        return;

    new 
String:sLevel[20];
    
GetClientCookie(clientdb_levelsLevelsizeof(sLevel));
    new 
iLevel StringToInt(sLevel);

    if(
iLevel >= 0) {
        
lm_SetClientLevel(clientiLevel);
        
LogMessage("DB: %N is level %i"clientiLevel);
    }

    new 
String:sXP[20];
    
GetClientCookie(clientdb_xpsXPsizeof(sXP));
    new 
iXP StringToInt(sXP);

    if(
iXP >= 0) {
        
lm_SetClientXP(clientiXP);
        
LogMessage("DB: %N has xp: %i"clientiXP);
    }
}


/////////////////////
//S A V E  T O  D B//
/////////////////////
public OnClientDisconnect(client)
{
    new 
iXP lm_GetClientXP(client);
    new 
iLevel lm_GetClientLevel(client);

    if(
iLevel >= 0) {
        new 
String:sXP[20];
        
Format(sXPsizeof(sXP), "%i"iXP);

        new 
String:sLevel[6];
        
Format(sLevelsizeof(sLevel), "%i"iLevel);

        
LogMessage("Writing client cookie: level %i, xp: %i"iLeveliXP);
        
SetClientCookie(clientdb_levelsLevel);
        
SetClientCookie(clientdb_xpsXP);
    }

Facts:
OnClientConnected(client) is setting xp to 0. (the core does this)
OnClientCookiesCached(client) loads the values from the db.
The latter will always be called after the former, right?

Last edited by Thrawn2; 03-17-2010 at 13:24.
Thrawn2 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 03:26.


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