AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [ANY] tLevelMod v0.1.3 (2010-04-05) (https://forums.alliedmods.net/showthread.php?t=121356)

Thrawn2 03-14-2010 18:36

[ANY] tLevelMod v0.1.3 (2010-04-05)
 
3 Attachment(s)
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.

kiraibrasil 03-14-2010 18:40

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Work in l4d2?

Thrawn2 03-14-2010 18:41

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
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.

kiraibrasil 03-14-2010 18:45

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
The additional benefit to having a level higher

Thrawn2 03-14-2010 19:03

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
so far none. benefits will be provided by plugins interacting with tLevelmod.

deltadude 03-15-2010 16:10

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
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?

Thrawn2 03-15-2010 18:26

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
what game, l4d2 or tf2?
did you set it up according to this guide?

Thrawn2 03-15-2010 19:28

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
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.

PMAvers 03-17-2010 11:06

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
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.)

Thrawn2 03-17-2010 13:19

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
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?

PMAvers 03-17-2010 14:29

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Actually, now that I think about it, I might've messed up ClientPrefs when I installed a SourceMod update. I *think* I fixed it, but I won't be able to check until I get home from class tonight.

kiraibrasil 03-17-2010 14:34

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
It iIt is possible to do this in the plugin to l4d2
When the players get a level he gains a point. To this point he may choose to increase your speed, jump, life and your attack / weapon damage. 1% Exeter to life
Finally the player in the highest level would be well

Your level 50 and you have 150 life 10% damage with 10% speed and 10% jum

Thrawn2 03-17-2010 14:40

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
not yet. but it will be.
l4d2 is still cosmetic so far.

Acecombat2 03-18-2010 03:03

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
what does client pref looking at? the steam id or the name?

i would really want it look at name. when i rerun left4dead2.exe it restart back to 0.

can the level give benefit for using gun or stat reward? (your plugin is good for a start)

Thrawn2 03-18-2010 08:58

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by Acecombat2 (Post 1121198)
what does client pref looking at? the steam id or the name?

steamid. which makes a lot more sense than by name.

Quote:

Originally Posted by Acecombat2 (Post 1121198)
can the level give benefit for using gun or stat reward?

this was asked and answered one post above yours:
Quote:

Originally Posted by [AAA] Thrawn (Post 1120606)
not yet. but it will be.
l4d2 is still cosmetic so far.


Acecombat2 03-18-2010 18:41

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by Acecombat2 (Post 1121198)
what does client pref looking at? the steam id or the name?

i would really want it look at name. when i rerun left4dead2.exe it restart back to 0.

can the level give benefit for using gun or stat reward? (your plugin is good for a start)

thx for reply. i'm using cracked one. so the steam id keep changing.....

psychonic 03-19-2010 07:49

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by Acecombat2 (Post 1121856)
thx for reply. i'm using cracked one. so the steam id keep changing.....

Guess you're SOL. No Steam. No support.

Thrawn2 03-21-2010 19:13

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
i've started working on a gungame mod using levelmod.
finally all the hard work pays off, take look at the code to see how little must be done, git source.

Thrawn2 03-23-2010 13:03

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
a bit like lego bricks everything comes together very nicely atm:

http://thrawn.einfachonline.net/imag...3_17_59_05.jpg

to make e.g. tGunGame compatible to XYZ you'd only have to replace small single bricks, like tLevelMod.Hud.XYZ and tLevelMod.Weapons.XYZ.

noodleboy347 03-23-2010 19:21

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by [AAA] Thrawn (Post 1126549)
a bit like lego bricks everything comes together very nicely atm:

http://thrawn.einfachonline.net/imag...3_17_59_05.jpg

to make e.g. tGunGame compatible to XYZ you'd only have to replace small single bricks, like tLevelMod.Hud.XYZ and tLevelMod.Weapons.XYZ.

Why isn't levelmod at the top?

Thrawn2 03-24-2010 02:38

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by noodleboy347 (Post 1126887)
Why isn't levelmod at the top?

it is the foundation tGunGame is built on.

Acecombat2 03-25-2010 05:17

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by kiraibrasil (Post 1120601)
It iIt is possible to do this in the plugin to l4d2
When the players get a level he gains a point. To this point he may choose to increase your speed, jump, life and your attack / weapon damage. 1% Exeter to life
Finally the player in the highest level would be well

Your level 50 and you have 150 life 10% damage with 10% speed and 10% jum


Thrawn2 03-25-2010 10:02

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
hacking it together - hardcoded: very easy. take a look at the (linked obove) tAttributes Alpha for tf2.
implementing it in a way so it can be used by [any] game, thats a lot harder and is what i'm working on atm.

Acecombat2 03-26-2010 07:35

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
ah i see..... "All In One"

:up:

Thrawn2 03-28-2010 08:04

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
this has been updated for compatibility reasons to tAttributes.
Finally some effects for l4d2/tf2 =D this is not just cosmetic anymore (if you want it too).

Annihilator 03-30-2010 20:14

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by [AAA] Thrawn (Post 1128296)
hacking it together - hardcoded: very easy. take a look at the (linked obove) tAttributes Alpha for tf2.
implementing it in a way so it can be used by [any] game, thats a lot harder and is what i'm working on atm.

So, you're going to make it support other games than L4D1/2 and TF2?

Magma Spire 03-30-2010 20:39

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
Any chance for Noodle's method of creating new xp requirements for levels? That is, instead of multiplying the original amount by a multiplier, just adding a base amount of xp to the total?

Not as fun as exponential xp requirements, but I like clean, rounded numbers myself. :P

EDIT: Might as well add some more comments here...

Big issue:
Using the levelmod.xp.hurt.sdkhooks.smx will cause a cacophony of errors in console (for the server), as well as somehow disable world damage (saw blades and bottomless pits I tested personally, may include payload explosions and trains). The deprecated plugin works without a flaw, though.

Suggestions:
Experience for assists and medic assists would be nice, though not necessary.
Setting "sm_lm_exp_maxbydmg" to zero disables experience through damage, instead of removing the experience ceiling ("0 = unlimited").
Disabling the level up sound with the particle effects would be nice if paired up.
Capping flags/pushing kart for experience? Didn't check it myself, but hey.
Possibly a chat message at the end of the game proclaiming the player with the highest level? (to be added to the "leader" core, of course).
It seems like "sm_lm_deathmessage" and "sm_lm_announce" have be remove/renamed as of 0.4. Any chance to get these back?

I understand that I'm not using the absolutely latest version, so you've probably gotten a lot more done since this one. :P

Enough suggestions for now, though... Everything else runs beautifully. It's a ton of fun to fight for the top level and gloat after you kill someone! Keep it up, man. I'll be testing this on my server for the time being.

Thrawn2 03-31-2010 01:56

Re: [ANY] tLevelMod v0.1.2 (2010-03-14)
 
Quote:

Originally Posted by Annihilator (Post 1133700)
So, you're going to make it support other games than L4D1/2 and TF2?

i was kinda hoping someone else would jump on this train. adding support for another game is really easy and doesnt require modifying any of the plugins. i'll probably write a how-to on this.

Quote:

Any chance for Noodle's method of creating new xp requirements for levels? That is, instead of multiplying the original amount by a multiplier, just adding a base amount of xp to the total?
You can achieve this by setting sm_lm_exp_reqmulti to 1.0. Everyone will be updated to their new level (because higher levels would require less xp) automatically. Furthermore i'm going to provide natives which are able to set the required points for a certain level, which would allow another plugin to load level requirements from a keyvalues file, db, random, whatever.

Quote:

Using the levelmod.xp.hurt.sdkhooks.smx will cause a cacophony of errors in console (for the server), as well as somehow disable world damage (saw blades and bottomless pits I tested personally, may include payload explosions and trains).
I will look into it, thank you.

Quote:

Setting "sm_lm_exp_maxbydmg" to zero disables experience through damage, instead of removing the experience ceiling ("0 = unlimited").
ack, will look into it.

Quote:

Disabling the level up sound with the particle effects would be nice if paired up.
ack, will look into it.

Quote:

Possibly a chat message at the end of the game proclaiming the player with the highest level? (to be added to the "leader" core, of course).
ack, will look into it.

Quote:

you've probably gotten a lot more done since this one.
not so much, but very important fixes ;) the sdkhooks version could actually work then btw ;) and it is much more accurate than the deprecated version.

Quote:

Everything else runs beautifully. It's a ton of fun to fight for the top level and gloat after you kill someone! Keep it up, man. I'll be testing this on my server for the time being.
awesome! i appreciate it!

chris1701 03-31-2010 02:34

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
actually, what is the benefit of level up? new skills or abilities?

Thrawn2 03-31-2010 03:50

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
this is a modular plugin. on its own its purely cosmetic. but you can combine it with tAttributes. there will be other plugins using levelmod too, give it some time.

Grundy 03-31-2010 18:52

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
I downloaded the plug in pack and uploaded it to my server and restarted my server...( i have the latest sourcemod ect..ect...)

Doesn't work.

Is there anything more we have to do to get this plug in to work? Do I need that colors.inc include? Do I need to do anything else but simply upload these plug ins?

Thrawn2 03-31-2010 19:03

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
installation manual
you just need to upload the plugins which fit your needs.
and some of them are specific to a single game. if you run a tf2 server, the l4d2 plugins wont work...

Grundy 03-31-2010 19:28

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
Quote:

Originally Posted by [AAA] Thrawn (Post 1134918)
installation manual
you just need to upload the plugins which fit your needs.
and some of them are specific to a single game. if you run a tf2 server, the l4d2 plugins wont work...


*edit
A buddy of mine installed it and it worked. Have no idea whats wrong with my server...

We both have nearly identical servers, so who knows.

Dragonshadow 04-02-2010 08:19

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
For tf2 can you make it do the achievement partical effect when you level? (Unless you're a cloaked or disguised spy)

Thrawn2 04-02-2010 08:53

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
Quote:

Originally Posted by Dragonshadow (Post 1136381)
For tf2 can you make it do the achievement partical effect when you level?

thats already included =D

Quote:

Originally Posted by Dragonshadow (Post 1136381)
Unless you're a cloaked or disguised spy

that check isnt. it's already fixed in the repository (for which you can track changes using rss)
i'll probably release another package over the weekend.

Grundy 04-02-2010 17:16

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
I got it to work finally and my community LOVES it! We will follow you and test it!

Question...

Can we wipe everyones level and start over?

For example: Every month have everyone start over.

If so, how?

Thanks.

Thrawn2 04-02-2010 17:50

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
Quote:

Can we wipe everyones level and start over?
Not yet, but i'll implement that feature.

well you could delete your clientprefs sqllite file, but if you're using it for sth else than tAttributes and tLevelmod, all that data would be lost too.

Grundy 04-02-2010 18:57

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
Quote:

Originally Posted by [AAA] Thrawn (Post 1136839)
Not yet, but i'll implement that feature.

well you could delete your clientprefs sqllite file, but if you're using it for sth else than tAttributes and tLevelmod, all that data would be lost too.

Thanks!

What exact clientprefs should i delete?

Can you give me the location please? ;)

Thrawn2 04-02-2010 19:15

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
2 Attachment(s)
Quote:

Originally Posted by Grundy (Post 1136923)
Can you give me the location please? ;)

\addons\sourcemod\data\sqlite\clientprefs-sqlite.sq3
but as i said, thats not recommended and is nothing more than an ugly hack.


you could also use the basic commands plugin i wrote today (which isnt in any package yet), but it can only set attributes of players currently on the server.

it gives you three commands:
sm_att_list - lists all available attributes and their id (used by the following cmd)
sm_att_set <OPT:#id|name> <#attributeID|'all'> <value> - all means: set every attribute of that target to value
sm_att_get <#id|name> - shows what attribute levels the target hat

Grundy 04-02-2010 19:51

Re: [ANY] tLevelMod v0.1.2 (2010-03-28)
 
I tried to download the plug in and got this message: Plugin failed to compile! Please try contacting the author.

I don't really understand the:
sm_att_set <OPT:#id|name> <#attributeID|'all'> <value>

Lets say I wanted to give Ed 20 points. How would I type that exactly? I plan on copy and pasting.

Where do I get the attributes ID? and do I type the <> symbols? I am not a programmer, just a server admin.

-----------------------------------------------------------------------------------------------------------------

Also, one user (my wife) levels up but her attributes do not save. They all show zero even when she puts the attribute point in. However,she is still gaining levels.

-----------------------------------------------------------------------------------------------------------------

AH! one more thing (sorry) As a soldier, I can hit a teammate on the same team with a rocket and it gives me experience. Is this working as intended?


All times are GMT -4. The time now is 18:23.

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