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

[ANY] tAttributes v0.1.1 (2010-04-05)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-28-2010 , 07:53   [ANY] tAttributes v0.1.1 (2010-04-05)
Reply With Quote #1

tAttributes
is a plugin providing a basic interface for developers to integrate some sort of rpg-like attribute system in their gameplay modifications - it is designed with modularity in mind and doesnt make use of any game-specific features. Everything which only works on certain games is split into seperate plugins.
Leaving the core as it is and just developing "attributes" is very easy, i'll provide an example later on.

A guide to install this on your server can be found on it's wiki at github, where the newest code (changelog, rss) can be found too. If you want to contribute to this project, please do so =D , send me your attribute-code or other stuff using the attributes include. If you've found any issues/bugs whatsoever, please post those either at the issues tab on the github page or here.


Currently available Attributes:
Team Fortress 2
Quote:
Dexterity (run faster), Strength (deal more damage), CritChance (...), LifeForce (more health)
Almost any game (tested with l4d2)
Quote:
Dexterity (run faster), LifeForce (more health)
Everyone of them provides some cvars to tweak them to your liking, see a list of all available cvars and a short explanation here.

Because you like screenshots so much...


Download:
The latest source-code can be found here, the version posted in this thread wont be updated very regular.
Same goes for the packaged versions. Grab them from the Downloads Section at github, to get the latest versions.


Update 2010-05-04:
* Added link to cvar list.
* A lot of fixes, for a full changelog take a look at the commit history here.
* If you've installed tAttributes on your server, update now.
Attached Files
File Type: zip attributes_r03.zip (91.3 KB, 440 views)
File Type: inc attributes.inc (2.2 KB, 429 views)
File Type: sp Get Plugin or Get Source (attributes.core.sp - 422 views - 10.7 KB)

Last edited by Thrawn2; 04-05-2010 at 07:44. Reason: updated to 0.1.1, added link to cvar-list
Thrawn2 is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-28-2010 , 07:53   Re: [ANY] tAttributes v0.1.0
Reply With Quote #2

Pre-Packaged Binaries

You dont want the hassle of selecting/installing attributes yourself and just want to play this?
Use these pre-compiled packages (they contain levelmod too).
Attached Files
File Type: zip l4d2_r03.zip (84.9 KB, 286 views)
File Type: zip tf2_r03.zip (104.4 KB, 287 views)

Last edited by Thrawn2; 04-05-2010 at 07:55.
Thrawn2 is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-28-2010 , 07:54   Re: [ANY] tAttributes v0.1.0
Reply With Quote #3

Developer Examples

1. Implementing your own attribute (please share it with us)

This is the most simple attribute i could think of explaining the natives you'll need. It basically just prints your attribute-level on spawn.
PHP Code:
#include <sourcemod>
#include <attributes>
#include <colors>

#pragma semicolon 1
#define PLUGIN_VERSION "0.1.0"

new g_Example[MAXPLAYERS+1];
new 
g_iExampleID;

public 
Plugin:myinfo =
{
    
name "tAttributes Mod, Example",
    
author "Thrawn",
    
description "A plugin for tAttributes Mod, Example, prints how many points you spend on this attribute.",
    
version PLUGIN_VERSION,
    
url "http://thrawn.de"
}

public 
OnPluginStart()
{
    
g_iExampleID att_RegisterAttribute("Example""Prints how many points you spend on this attribute."att_OnExampleChange);

    
HookEvent("player_spawn"Event_Player_Spawn);
}

public 
OnPluginEnd()
{
    
att_UnregisterAttribute(g_iExampleID);
}

public 
att_OnExampleChange(iClientiValueiAmount) {
    
g_Example[iClient] = iValue;

    if(
iAmount != -&& IsClientInGame(iClient))
    {
        
CPrintToChat(iClient"You have decided to waste another {green}%i{default} attribute point(s), which sums up to %i wasted points. Fool."iAmountiValue);
    }
}

public 
Event_Player_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
att_IsEnabled())
    {
        new 
iClient GetClientOfUserId(GetEventInt(event"userid"));
        
CPrintToChat(iClient"You have wasted {green}%i{default} attribute points."g_Example[iClient]);
    }

Attached Files
File Type: sp Get Plugin or Get Source (attributes.example.sp - 289 views - 1.3 KB)

Last edited by Thrawn2; 03-28-2010 at 08:45.
Thrawn2 is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-28-2010 , 08:35   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #4

If you are using the Basic Donator Interface toazron1 wrote, you can use this plugin to give Donators 2 Attribute Points for leveling up. (The normal attributes.bridge.levelmod is still needed.)
Attached Files
File Type: sp Get Plugin or Get Source (attributes.bridge.levelmod.donators.sp - 295 views - 588 Bytes)
Thrawn2 is offline
bouncer
Veteran Member
Join Date: Apr 2009
Old 03-28-2010 , 12:33   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #5

Thanks, sounds interesting!
Will look into this further later!
__________________


bouncer is offline
GoldRenamon
Guest
Old 03-28-2010 , 14:04   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #6

Getting this spam in logs:
Code:
L 03/28/2010 - 13:03:32: [SM] Plugin encountered error 15: Array index is out of
 bounds
L 03/28/2010 - 13:03:32: [SM] Displaying call stack trace for plugin "attributes
.strength.smx":
L 03/28/2010 - 13:03:32: [SM]   [0]  Line 76, attributes.strength.sp::OnTakeDama
ge()
L 03/28/2010 - 13:03:32: [SM] Plugin encountered error 15: Array index is out of
 bounds
L 03/28/2010 - 13:03:32: [SM] Displaying call stack trace for plugin "attributes
.strength.smx":
L 03/28/2010 - 13:03:32: [SM]   [0]  Line 76, attributes.strength.sp::OnTakeDama
ge()

Is there a cmd to reset attributes for a player?

Last edited by GoldRenamon; 03-28-2010 at 14:45.
PMAvers
Member
Join Date: Sep 2009
Old 03-28-2010 , 22:11   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #7

Yeah, getting a lot of those messages in the console as well. (Using the TF2 bundle version.)

Also, the in-game menu doesn't seem to work. I've tried using !att, but it doesn't do anything.

Quote:
L 03/28/2010 - 20:46:27: [SM] Native "IsClientInGame" reported: Client index 0 is invalid
L 03/28/2010 - 20:46:27: [SM] Displaying call stack trace for plugin "levelmod.xp.hurt.sdkhooks.smx":
L 03/28/2010 - 20:46:27: [SM] [0] Line 59, levelmod.xp.hurt.sdkhooks.sp::OnTakeDamage()
L 03/28/2010 - 20:51:01: [SM] Native "IsClientInGame" reported: Client index 101 is invalid
L 03/28/2010 - 20:51:01: [SM] Displaying call stack trace for plugin "levelmod.xp.hurt.sdkhooks.smx":
L 03/28/2010 - 20:51:01: [SM] [0] Line 59, levelmod.xp.hurt.sdkhooks.sp::OnTakeDamage()
L 03/28/2010 - 20:51:26: [SM] Native "IsClientInGame" reported: Client index 101 is invalid
L 03/28/2010 - 20:51:26: [SM] Displaying call stack trace for plugin "levelmod.xp.hurt.sdkhooks.smx":
L 03/28/2010 - 20:51:26: [SM] [0] Line 59, levelmod.xp.hurt.sdkhooks.sp::OnTakeDamage()
EDIT: ...Wait, seriously? I reloaded the plugins (with a sm plugins refresh), and got the message about how the attributes were registered successfully... and now the menu works. D:

Granted, it didn't seem to remember that I got to level two, and it's telling me that I have 0 points to spend. Console spam died, at least.

Last edited by PMAvers; 03-28-2010 at 22:23.
PMAvers is offline
GoldRenamon
Guest
Old 03-28-2010 , 22:39   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #8

I still have console spam, also, players get experience from blowing up their teammates with rockets or grenades even though it does no damage.
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-29-2010 , 02:01   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #9

updated. hopefully fixes your problems.
a plugin to reset someones attributes will be coming soon.
Thrawn2 is offline
Acecombat2
Senior Member
Join Date: Nov 2009
Old 03-29-2010 , 05:04   Re: [ANY] tAttributes v0.1.0 (2010-03-28)
Reply With Quote #10

levelmod notify spamming my console about player death. Rolf.

I want to set xp more than 10 but it won't go further.

what command to see attribute points?. maybe i wrong does attribute given after level up or after several exp gained?
__________________
I'm Noob So Please Don't Criticise me (Fail In Engglish)
Acecombat2 is offline
Reply



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 16:32.


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