AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [EXTENSION|ALL] RPGTools (https://forums.alliedmods.net/showthread.php?t=161522)

Swixel 07-08-2011 06:48

[EXTENSION|ALL] RPGTools
 
2 Attachment(s)
THIS IS ALPHA (AND/OR SPARTA)


ConVars
sm_rpgtools_version
- version
sm_rpgtools_please_spam_my_logs
- Enables debugging printing on setting of variables and on the modifications to damage (useful for debugging if something's wrong)


Licence

This extension, and the include, are licenced under AGPLv3. Anything attached to it must also be AGPLv3. This means that if anyone asks for your source code, you must provide it free of charge.

Why am I doing this? To help the community that helps you.

What is this?
A simple extension that provides two trivial natives controlling bonuses on damage, not taking damage (dubbed "shield"), speed, and health.

Yes, this can be done using various other mods (for certain games), the idea behind this is to use simple things to replace the need for a handful of extensions.

Natives:
  • native bool:RPG_SetPlayerStat(iClient, RPG_STAT, Float:fValue);
  • native bool:RPG_SetPlayerStats(iClient, Float:fDamageStat=0.0, Float:fShieldStat=0.0, iHealthStat=0, Float:fSpeedStat=0.0);
Pretty obvious what they do.

There's also a forward:
  • forward Action:RPG_GetPlayerData(iClient);
The forward is called when a player is registerd with zeroed stats (i.e. 0,0,0,0).

What you need to know:
  • Damage and shield are both floats, speed is a float, and health is an integer (though you input them all as floats when you are setting a single statistic).
  • Any statistic set to 0 will result in the default value being used.
  • Using negative numbers won't work, because I'm a bad person -- anything lower than 1 will trigger the default status.
Damage and Shield
  • Damage adds a percentage of damage (where 100.0 is 100%, and 1.0 is 1%);
  • Shield subtracts a percentage of incoming damage (where 100.0 is 100%, and 1.0 is 1%);
  • They are applied in the way that makes the most sense (damage increase from attacker, shielding on defender).
Health
  • Setting health sets the maximum health;
  • Setting health to 0 will yield the default health for the player.
Speed
  • This taps into the player speed, which is what I believe is called first in everything.
What if gamedata breaks?
Is my game supported?
  • Not a clue, check the post below, otherwise add gamedata and find out. Chances are it is.
Testing
  • Squat, I'm pushing this now because people wanted it from me.
Why do you even have this if you weren't going to use it?
  • I was working on a rewrite of a popular mod that was on my CS:S server (~2004-2005), which was similar to "The Hidden", but used stock CS:S weapons and beefed up a player. I didn't write the mod alone, but I helped work on various aspects (mostly planning :P, but now I can code!).
What's in the zip?
  • The include (pawn/include/rpgtools.inc)
  • gamedata for hl2mp, tf, dod, and cstrike (all source versions)..
Where's the source?
https://bitbucket.org/aws/rpgtools

Swixel 07-08-2011 09:26

Re: [EXTENSION|ALL] RPGTools
 
Game Compatibility Listing

(Reversed for a lot more junk as time goes by)


Counter-Strike Source
  • Statistics:
    • Speed -> Works
    • Health -> Does not work (the game spawns you with a set 100)
    • Damage -> Unknown (untested).
    • Shield -> Unknown (untested).
  • Testing Credits:
    • GoD-Tony

GoD-Tony 07-12-2011 09:12

Re: [EXTENSION|ALL] RPGTools
 
How is this coming along?

I still haven't had a chance to test the Damage/Shield features, but it was great to see the per-client MaxSpeed changes working.

Swixel 07-12-2011 16:38

Re: [EXTENSION|ALL] RPGTools
 
Quote:

Originally Posted by GoD-Tony (Post 1509076)
How is this coming along?

Not too badly. I have a few more things I should test, but the content mirrors down under are overwhelmed, so it'll probably be several days before I can even test them on TF2.

Quote:

Originally Posted by GoD-Tony (Post 1509076)
I still haven't had a chance to test the Damage/Shield features, but it was great to see the per-client MaxSpeed changes working.

I think the main thing for CS:S is the speed (for general modding), so that's not a problem :)

GoD-Tony 07-13-2011 12:31

Re: [EXTENSION|ALL] RPGTools
 
Quote:

Originally Posted by Swixel (Post 1509385)
I think the main thing for CS:S is the speed (for general modding), so that's not a problem :)

And I will start using it in my servers when the mystery map change issue is fixed. :)

Swixel 07-13-2011 17:01

Re: [EXTENSION|ALL] RPGTools
 
Yeah, I need to do some more testing to work out what's happening there. I'm unhooking and it shouldn't be messing with anything bad ... I guess I could pull it to pieces a few more times to track it down...

If anyone has any ideas, I'd like to hear them... at the moment I assume it's something to do with hooking but not cleanly unhooking on map change...

Swixel 07-17-2011 17:39

Re: [EXTENSION|ALL] RPGTools
 
There are some more untested natives, which I won't update the first post to reflect yet. Trying an update to see if this resolves the mapchange issue.


All times are GMT -4. The time now is 17:36.

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