Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-09-22 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
September 21, 2012, 09:42:53 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Extension] W3Mana  (Read 1296 times)
Revan
Sr. Member
****
Posts: 263



View Profile
« on: October 11, 2011, 01:02:12 PM »

project abandoned
(atleast for now)

War3Source Mana System



I've made a mana system for war3source via a sourcemod extension(extension because i want to learn how to make them)
be warned this extensions takes use of the DialogType_Message (maxvalue method)

Races using W3Mana:
- Anivia

Todo:
- request a feature

Changelog:
1.0 - inital release
2.0 - completly rewritten
2.1 - natives were fixed

Console Variables:
Code:
war3_mana_interval - default: '0.5' - Determines the W3Mana updating interval(needs mapchange in order to make changes work).
war3_mana_color - default: '255 255 0 255' - Determines the W3Mana default message color(r g b a).
war3_mana_maxvalue - default: '100' - Determines the W3Mana default max value.

Links:
Linux build(orangebox valve)
Windows build(orangebox valve)
Sourcecode avaible here

Examples:
Change Mana Value
Code:
public SetManaPowa(client,manavalue)
{
   W3SetMana(client,iValue,manavalue);
}

Get Mana Value
Code:
public GetManaPowa(client)
{
   return W3GetMana(client,iValue);
}

Mark the client as a mana system user
Code:
public UseManaYo(client)
{
   //as you can see some "ManaTypes" need an optional parameter to be passed
   W3SetMana(client,bActive,true,War3_GetRace(client));
}

Retrieve mana prefix
Code:
public PrintPrefixToChat(client)
{
   new String:szPrefix[64];
   W3GetMana(client,szPrefix,szPrefix,sizeof(szPrefix));
}
« Last Edit: August 23, 2012, 09:22:23 AM by Revan » Logged

Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 402


⠠⠵


View Profile
« Reply #1 on: October 11, 2011, 02:25:59 PM »

Could you add a function to configure the displayed string? It's currently hardcoded to Mana (UTIL_Format( num_msg, sizeof(num_msg), "Mana: %i", W3_GetMana(client)); ) but I think it would be better off being flexible here. For example I have a Mecha race on L4D that uses self recharging fuel for a jetpack wich is basically the same as mana.
Logged

Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #2 on: October 11, 2011, 02:33:26 PM »

Sure I will add this feature
Logged

Necavi
Full Member
***
Posts: 217


View Profile
« Reply #3 on: October 28, 2011, 01:16:49 AM »

Could you add the ability to set a maximum amount of mana per race? Convars are nice, but not always as useful Tongue

Also, I was playing around with the extension for the first time and I'm afraid I keep getting this error:

Code:
L 10/28/2011 - 03:31:33: [SM] Unable to load extension "w3mana.ext": vstdlib_i486.so: cannot open shared object file: No such file or directory
L 10/28/2011 - 03:31:34: [SM] Unable to load plugin "war3source/War3Source_Submarine.smx": Native "W3ToggleMana" was not found
« Last Edit: October 28, 2011, 02:31:21 AM by Necavi » Logged

Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #4 on: October 28, 2011, 04:54:07 AM »

Okay I'll add this feature too! update should be released soon
and this vstdlib_i486.so error should not occur you can try downloading these bin's(if they are missing) into your srcds/css/bin folder(linux ofc)
vstdlib_i486.so
tier0_i486.so
tier0_s_i486.so
Logged

Necavi
Full Member
***
Posts: 217


View Profile
« Reply #5 on: October 28, 2011, 04:58:19 AM »

Ahhh, thanks, should've realized that, I'll blame it on the fact that its 2 in the morning ;p
Logged

-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #6 on: May 07, 2012, 07:12:31 AM »

Revan,

Quoting you "be warned this extensions takes use of the DialogType_Message (maxvalue method)"

What do you mean?  Will this method crash the game or something?

Is w3mana stable to use or still beta?

if it is stable, I'll start implementing it into some new races.



Also maybe want to modify it to include, Rage, Energy, Focus.  BUT, if the mana system doesn't say its a mana system, then we could use it for all of those and name them our selves right?
« Last Edit: May 07, 2012, 07:27:31 AM by -El Diablo » Logged
Vulpone
Full Member
***
Posts: 140



View Profile Email
« Reply #7 on: May 07, 2012, 01:41:29 PM »

it works like a mana thing.

it's also stable as far as I could tell back when we still used it. What he meant by DialogType was it uses a special place to display the mana counter (top left corner with the green background)
Logged

Sapere aude!
Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #8 on: May 12, 2012, 05:06:17 AM »

It's stable, I've already finished that "custom prefix thing" and max mana per race but I need to test it

EDIT: I've decided to rework the whole System since it isn't written verry well
« Last Edit: May 12, 2012, 08:13:42 AM by Revan » Logged

-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #9 on: May 12, 2012, 08:13:11 AM »

It's stable, I've already finished that "custom prefix thing" and max mana per race but I need to test it

let me know when its ready for beta testing and send it to the custom SVN folder for me to download and test, along with any instructions that you would like me to test it under in a readme.txt file.
« Last Edit: May 12, 2012, 08:14:48 AM by -El Diablo » Logged
Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #10 on: May 17, 2012, 05:03:13 AM »

It's done!
This new version has all the features which were requested( custom prefix+mana cap and mana hide if player is death )
I've also "fixed" the vstdlib_i486.so dependency.
The new version comes with a complete new set of natives. I've decided to reduce the amount of needed natives so there are only 3 natives in this version, they're are designed to be very dynamic.
See examples in first post

tested on:
cs:s windows and linux
« Last Edit: May 17, 2012, 05:08:05 AM by Revan » Logged

Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #11 on: May 18, 2012, 02:24:47 AM »

Update - 2.1
natives are fixed and will work properly now
« Last Edit: May 18, 2012, 02:57:49 AM by Revan » Logged

-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #12 on: May 18, 2012, 05:23:02 AM »

I hope this extension works for team fortress 2, cause I will be using it this weekend.

Once I fully test it, I'll add it to my main server.
Logged
Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #13 on: May 18, 2012, 11:32:15 AM »

The System is designed to very rarely use hackish stuff(except that CBasePlayer::m_lifeState offset) idk if that toptext work in tf2 but since it is a default helper function which can easily be used by vsp's. But if that toptext works there should be no problem.

please report if it is working or not
« Last Edit: May 18, 2012, 12:25:06 PM by Revan » Logged

-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #14 on: June 01, 2012, 11:46:57 AM »

The System is designed to very rarely use hackish stuff(except that CBasePlayer::m_lifeState offset) idk if that toptext work in tf2 but since it is a default helper function which can easily be used by vsp's. But if that toptext works there should be no problem.

please report if it is working or not

what if I'm using advertisments that display text on top of the screen left hand corner.. with this interfer with that?
Logged
Revan
Sr. Member
****
Posts: 263



View Profile
« Reply #15 on: June 01, 2012, 02:51:22 PM »

Are u using mani admin plugin(or similar)? Idk, they should overwrite them so its no big deal
Logged

-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #16 on: June 03, 2012, 11:49:46 AM »

I've tried to use this entension for TF2 and failed multiple times.  I worked on it for 3 hours straight and haven't been able to get past these errors:

Code:
L 06/03/2012 - 12:52:59: SourceMod error session started
L 06/03/2012 - 12:52:59: Info (map "koth_viaduct") (file "errors_20120603.log")
L 06/03/2012 - 12:52:59: [SM] Native "W3SetMana" reported: Client(1) isn't connected yet!
L 06/03/2012 - 12:52:59: [SM] Displaying call stack trace for plugin "war3source\War3Source_005_BloodPriest.smx":
L 06/03/2012 - 12:52:59: [SM]   [0]  Line 102, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::OnClientPutInServer()
L 06/03/2012 - 12:58:30: [SM] Native "W3SetMana" reported: Client(1) isn't connected yet!
L 06/03/2012 - 12:58:30: [SM] Displaying call stack trace for plugin "war3source\War3Source_005_BloodPriest.smx":
L 06/03/2012 - 12:58:30: [SM]   [0]  Line 201, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::RemovePassiveSkills()
L 06/03/2012 - 12:58:30: [SM]   [1]  Line 158, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::OnRaceChanged()
L 06/03/2012 - 12:58:30: Error log file session closed.
L 06/03/2012 - 12:59:03: SourceMod error session started
L 06/03/2012 - 12:59:03: Info (map "koth_viaduct") (file "errors_20120603.log")
L 06/03/2012 - 12:59:03: [SM] Native "W3SetMana" reported: Client(1) isn't connected yet!
L 06/03/2012 - 12:59:03: [SM] Displaying call stack trace for plugin "war3source\War3Source_005_BloodPriest.smx":
L 06/03/2012 - 12:59:03: [SM]   [0]  Line 138, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::OnWar3PlayerAuthed()
L 06/03/2012 - 12:59:25: [SM] Native "W3GetMana" reported: Client(1) isn't connected yet!
L 06/03/2012 - 12:59:25: [SM] Displaying call stack trace for plugin "war3source\War3Source_005_BloodPriest.smx":
L 06/03/2012 - 12:59:25: [SM]   [0]  Line 256, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::W3UseMana()
L 06/03/2012 - 12:59:25: [SM]   [1]  Line 289, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::OnUltimateCommand()
L 06/03/2012 - 13:05:32: [SM] Native "W3SetMana" reported: Client(1) isn't connected yet!
L 06/03/2012 - 13:05:32: [SM] Displaying call stack trace for plugin "war3source\War3Source_005_BloodPriest.smx":
L 06/03/2012 - 13:05:32: [SM]   [0]  Line 196, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::RemovePassiveSkills()
L 06/03/2012 - 13:05:32: [SM]   [1]  Line 153, D:\sourcemod\War3SourceDiablo\War3Source_005_BloodPriest.sp::OnRaceChanged()

I've tried using ValidPlayer, OnClientConnected(client), OnWar3PlayerAuthed(client), OnWar3PluginReady(), etc.. and haven't been able to get this to work for TF2.

If someone comes up with a solution for this, please private message me! thanks!


ps..

i was able to remove some errors, but it still didn't ever display the mana on topleft nor be able to use it.
Logged
Vulpone
Full Member
***
Posts: 140



View Profile Email
« Reply #17 on: June 04, 2012, 03:36:38 AM »

i thought TF2 can use SetHudTextParams (http://docs.sourcemod.net/api/index.php?fastload=show&id=842&).
the reason Revan used the top left corner to display the mana was because in CS:S, there really was no room to display text. gameME used an interesting space i think, but it was way too much in the center. i also don't think CenterText was all that elegant, so i think he didn't have much choice left.
afaik TF2 has some more room to control the HudText, as well as custom colors and channels, so why not give that a try.
Logged

Sapere aude!
-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #18 on: June 05, 2012, 06:35:03 AM »

i thought TF2 can use SetHudTextParams (http://docs.sourcemod.net/api/index.php?fastload=show&id=842&).
the reason Revan used the top left corner to display the mana was because in CS:S, there really was no room to display text. gameME used an interesting space i think, but it was way too much in the center. i also don't think CenterText was all that elegant, so i think he didn't have much choice left.
afaik TF2 has some more room to control the HudText, as well as custom colors and channels, so why not give that a try.

I understand i can do this with sourcemod, but was really hoping on a extention to work.  If I ever get time, i'll download Visual C++ from Microsoft or what ever i need to compile my own extentions.  Maybe make War3source a full scale extention (stuff that has no bugs and has been in war3source code forever and does not need any modficiations)

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!