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

How to detect TF2's "fullmoon"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-21-2012 , 09:52   How to detect TF2's "fullmoon"
Reply With Quote #1

Hi,

is there any way in TF2 to find out if fullmoon is set or not?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 11-21-2012 , 10:32   Re: How to detect TF2's "fullmoon"
Reply With Quote #2

Code:
#include <tf2>

new bool:bFullMoon;

public Action:TF2_OnIsHolidayActive( TFHoliday:holiday, &bool:bEnabled )
{
    if( holiday == TFHoliday_FullMoon )
        bFullMoon = bEnabled;
    return Plugin_Continue;
}

Last edited by Leonardo; 11-21-2012 at 11:00.
Leonardo is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-21-2012 , 10:54   Re: How to detect TF2's "fullmoon"
Reply With Quote #3

But isn't that function there to manipulate the server result of that check? So that it would call it with holiday == TFHoliday_FullMoon even when it's not halloween, just with the default return value of false?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-21-2012 , 10:55   Re: How to detect TF2's "fullmoon"
Reply With Quote #4

What I need would be the real result of that function
__________________

Last edited by Tauphi; 11-21-2012 at 10:58.
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 11-21-2012 , 11:01   Re: How to detect TF2's "fullmoon"
Reply With Quote #5

If it's a fullmoon, bFullMoon will be true, false otherwise (so it reset it).
You're not required to change current holiday mode/state.
and FullMoon isn't same as Halloween.
however, TF2_OnIsHolidayActive is calling about each frame.

Last edited by Leonardo; 11-21-2012 at 11:02.
Leonardo is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-21-2012 , 17:39   Re: How to detect TF2's "fullmoon"
Reply With Quote #6

Quote:
Originally Posted by Tauphi View Post
But isn't that function there to manipulate the server result of that check? So that it would call it with holiday == TFHoliday_FullMoon even when it's not halloween, just with the default return value of false?
The same function is used to change the holiday, yes. The enabled cvar is a reference. Changing it and returning Plugin_Changed will change the server's notion of whether a specific holiday is in effect.

This is how TF2 Force Holidays plugin works (and presumably how the tf_forced_holiday cvar works; this cvar is restricted to just one holiday at a time, which is why the plugin exists in the first place).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-21-2012 at 17:40.
Powerlord 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 07:47.


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