Raised This Month: $248 Target: $400
 62% 

psyRTD - An RTD (Roll the Dice) Core with Modules for All Games


Post New Thread Reply   
 
Thread Tools Display Modes
Author
psychonic

BAFFLED
Join Date: May 2008
Plugin ID:
1411
Plugin Version:
1.0.1
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Modular RTD core to host rtd effects
    Unapprover:
    Reason for Unapproving:
    no longer supporting. may have issues on some games. someone feel free to takeover
    Old 01-17-2010 , 20:25   psyRTD - An RTD (Roll the Dice) Core with Modules for All Games
    Reply With Quote #1

    WHAT?!?!?!?!! ANOTHER RTD PLUGIN?! BUT WE ALREADY HAVE ONE FOR TF2, CSS, AND ZOMBIE MASTER(?)

    ^ true, but...

    psyRTD is a modular RTD Core that can host many effect plugins.


    This will lead to many more games being able to have rtd fun without having to edit existing plugins. This will save redundant code on effects that works on multiple games and will easily allow others to contribute effect plugins for their favorite game or generic effect plugins that work across multiple games.

    When making modules (plugins) for psyRTD, you register an effect, good or bad, give the effect a name, and specify a callback to use if that effect is chosen. psyRTD does all the RTD logic itself.

    Natives (see psyrtd.inc for more details and the psyrtd-example.sp for usage example):
    PHP Code:
    enum psyRTDAction {
        
    psyRTD_Continue,       // accept the roll
        
    psyRTD_NotApplicable,  // effect doesn't work on or apply to current player (ex. because of class/team/game/state)
                               //   this will trigger a re-roll automatically if psyrtd_allowunusable is set to 0 (default)
        
    psyRTD_Reroll          // re-roll (usually because effect is disabled. return the former value if effect just doesn't apply
    };

    enum psyRTDEffectEndReason {
        
    psyRTDEndReason_Unknown,
        
    psyRTDEndReason_TimeExpired,
        
    psyRTDEndReason_PlayerDied,
        
    psyRTDEndReason_PlayerLeft  //  uses OnClientDisconnect
    };

    functag psyRTDEffectCallback psyRTDAction:public(client);

    native psyRTD_RegisterEffect(type, const String:name[], psyRTDEffectCallback:callback);

    native psyRTD_RegisterTimedEffect(type, const String:name[], Float:durationpsyRTDEffectCallback:starteffectpsyRTDEffectEndCallback:killeffect);

    native psyRTD_ChangeEffectDuration(iRTDEffectIdeffectTypeFloat:duration);

    native psyRTD_UnregisterEffect(iRTDEffectIdeffectType);

    native psyRTDGame:psyRTD_GetGame();

    native psyRTD_PrintToChat(client, const String:format[], any:...);

    stock psyRTD_PrintToChatAll(const String:format[], any:...); 
    Cvars:
    (Plugin will auto-create cfg/sourcemod/psyrtd.cfg)
    psyrtd_goodchance - Decimal chance to roll a good effect versus a bad effect (between 0.0 and 1.0, default 0.5)
    psyrtd_waittime - Time that must be waited between subsequent dice rolls (in seconds)
    psyrtd_waitmode - Wait Mode. 0 (default) - Applies to whole server. 1 - Applies to each player individually.
    psyrtd_waitpenalty - Reset wait timer if rtd is called again too soon. 0 (default) - Disabled. 1 - Enabled. Not recommended for wait mode 0.
    psyrtd_allowunusable - Allow wasted rolls (no auto re-roll when rolling effect not applicable to current class/team). Default 0 (off).
    psyrtd_adminflag - Admin flag required to be able to use rtd (ex. \"b\") Default \"\" (none)

    You can add as many effect modules as you want. They will stack fine.

    Plugin developers, feel free to create new creative ones, even if it's just one or two effects.

    Premade Effect Modules
    :

    Thanks to:
    Dragonshadow - Motivation + promise of generic effects plugin.
    Pimpinjuice - Damage stock.
    pheadxdll - RTD effects that I ripped off.

    Examples:
    The psyrtd-example.sp shows a basic single-effect plugin that can be used as a template.

    Changelog:
    Code:
    1.0.1
    + Added time left on wait message to avoid confusion
    - Fixed minor issue with text coloring on roll message
    
    1.0
    Initial supported release
    Attached Files
    File Type: sp Get Plugin or Get Source (psyrtd-example.sp - 582 views - 1.5 KB)
    File Type: inc psyrtd.inc (3.0 KB, 453 views)
    File Type: sp Get Plugin or Get Source (psyrtd.sp - 558 views - 19.3 KB)
    File Type: smx psyrtd.smx (11.4 KB, 493 views)

    Last edited by psychonic; 11-27-2013 at 09:10.
    psychonic is offline
    Dragonshadow
    BANNED
    Join Date: Jun 2008
    Old 01-17-2010 , 20:26   Re: psyRTD - A Modular RTD Core
    Reply With Quote #2

    and so it begins
    Dragonshadow is offline
    Thrawn2
    Veteran Member
    Join Date: Apr 2009
    Old 01-19-2010 , 02:00   Re: psyRTD - A Modular RTD Core
    Reply With Quote #3

    i like.

    i have one suggestion though:
    split the plugin/interface once more. make natives like psy_RegisterEffect, psy_RunRandomEffect(client), psy_RunEffect(client,iEffectIdx), psy_GetEffectData(iEffectIdx), psy_GetEffectCount(psyRTDEffectType:type) (psyRTDEffectType_All could come in handy here) etc and use them to implement a seperate rtd plugin.
    This way it would be possible to have several front-ends, not only realizing a rtd-plugin, but it would also allow a plugin like presents to use the same effects. Plus: you could do an external plugin for an admin menu entry.
    I'd like that very much =D
    Thrawn2 is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-19-2010 , 07:54   Re: psyRTD - A Modular RTD Core
    Reply With Quote #4

    Quote:
    Originally Posted by [AAA] Thrawn View Post
    i like.

    i have one suggestion though:
    split the plugin/interface once more. make natives like psy_RegisterEffect, psy_RunRandomEffect(client), psy_RunEffect(client,iEffectIdx), psy_GetEffectData(iEffectIdx), psy_GetEffectCount(psyRTDEffectType:type) (psyRTDEffectType_All could come in handy here) etc and use them to implement a seperate rtd plugin.
    This way it would be possible to have several front-ends, not only realizing a rtd-plugin, but it would also allow a plugin like presents to use the same effects. Plus: you could do an external plugin for an admin menu entry.
    I'd like that very much =D
    I think you're on to something...
    psychonic is offline
    SuperShadow
    SourceMod Donor
    Join Date: Jun 2008
    Location: Westminster, MD
    Old 01-19-2010 , 08:50   Re: psyRTD - A Modular RTD Core
    Reply With Quote #5

    Not that you need any more work psyconic, but beyond the presents plugin mentioned by Thrawn, there is also the RMF Ability Pack. It has some good effects that would work out ok as RTD rewards. They are just too over powering to be available all the time.
    SuperShadow is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-19-2010 , 09:17   Re: psyRTD - A Modular RTD Core
    Reply With Quote #6

    Quote:
    Originally Posted by SuperShadow View Post
    Not that you need any more work psyconic, but beyond the presents plugin mentioned by Thrawn, there is also the RMF Ability Pack. It has some good effects that would work out ok as RTD rewards. They are just too over powering to be available all the time.
    I think I am going to run with Thrawn's idea and work on the backend more and let others work on effects for now. While the API will change, it will be mostly additions. I expect effect plugins would only need minor tweaks to fix compatibility.

    It does make sense to make it even more modular as many types of plugins use random effects, such as rtd plugins (obviously), rune-type plugins (find effect object; hold it and effect til death; then drop object), presents-type plugins (random timed effects dropped on death), effect purchasing plugins, such as the "Candy Credit" mod, and more.

    There's no reason for all the effects to be rewritten or copy/pasted for every plugin just as there's no reason to have logic copy/pasted or rewritten for each game just because of differing effect sets. Sourcemod was made to be able to be modular but very few plugins take advantage of it to that extent.

    Stay tuned.
    psychonic is offline
    Hipster
    SourceMod Donor
    Join Date: Jun 2009
    Location: Florida
    Old 01-19-2010 , 16:08   Re: psyRTD - A Modular RTD Core
    Reply With Quote #7

    Nice work. It'll be interesting to see what other modules come out for this (I lol'd at the "bad" overtime roll).

    Quote:
    Originally Posted by psychonic View Post
    It does make sense to make it even more modular as many types of plugins use random effects, such as rtd plugins (obviously), rune-type plugins (find effect object; hold it and effect til death; then drop object), presents-type plugins (random timed effects dropped on death), effect purchasing plugins, such as the "Candy Credit" mod, and more.
    In that case, maybe you should change the plugin name to psyFX.
    Hipster is offline
    henk717
    Member
    Join Date: Jun 2009
    Old 01-27-2010 , 16:39   Re: psyRTD - A Modular RTD Core
    Reply With Quote #8

    I was looking for something Like this sp manu thanks for making it.
    Works great on my Linux hl2dm server with sm 1.2.0
    __________________


    www.bouncyball.eu - Revolution Coop - Join - Spectate
    henk717 is offline
    Sexual Harassment Panda
    Veteran Member
    Join Date: Dec 2008
    Location: San Diego, CA
    Old 02-17-2010 , 02:10   Re: psyRTD - A Modular RTD Core
    Reply With Quote #9

    awesome. have been waiting for something like this for a while. regular old rtd was getting old, the presents you got with presents were kind of odd, and the rmf ability menu was just game-breaking.
    __________________
    Sexual Harassment Panda is offline
    WGSXFrank
    Member
    Join Date: Apr 2010
    Old 04-14-2010 , 13:47   Re: psyRTD - A Modular RTD Core
    Reply With Quote #10

    Wow! This was exactly what I had hoped to find here! I can't wait to to able to use this with custom effects. The basic RTD is really boring me as of late on my server.

    Too bad I don't know how to code squat. >_<
    WGSXFrank is offline
    Reply


    Thread Tools
    Display Modes

    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 06:07.


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