Jump to content

RPG Dice Roller Plugin


Insydius

Recommended Posts

Hello all,

Being a former phpBB user I loved making RPG communities. Long-term however I've always loved using IPB, IPS. However I could never understand how IPS modding works myself and am curious to see if anyone would be able to create a plugin that uses an old dice roller I developed for phpBB to work in IPS. It would randomize 5 different dice rollers from making a post/reply, store it in database, and output it in the post publicly. To keep users from deleting their posts to get better rolls, I'd disable users from deleting their own posts and have to stick to what the dice gods gave them. Even administrators/moderators were unable to edit the dice values since they lacked access to modifying the SQL database.

The breakdown how it worked was these SQL variables were stored in the database where the forum topic stored the poster ID, name, IP, timestamp, post, etc..

ADD `dice_roll_1` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Dice Mod d4',
ADD `dice_roll_2` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Dice Mod d6',
ADD `dice_roll_3` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Dice Mod d8',
ADD `dice_roll_4` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Dice Mod d12',
ADD `dice_roll_5` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Dice Mod d20',

And in the post functions, this mod would setup the dice values to be sent to the database.

'dice_roll_1'        => rand(1,4),
'dice_roll_2'        => rand(1,6),
'dice_roll_3'        => rand(1,8),
'dice_roll_4'        => rand(1,12),
'dice_roll_5'        => rand(1,20),

Then whenever a user viewed a topic, they would see the values in the post much like everything else i.e. poster name, timestamp, post.

rolled a <strong>{postrow.DICE_ROLL_1}</strong> (d4), <strong>{postrow.DICE_ROLL_2}</strong> (d6), <strong>{postrow.DICE_ROLL_3}</strong> (d8), <strong>{postrow.DICE_ROLL_4}</strong> (d12), <strong>{postrow.DICE_ROLL_5}</strong> (d20)

Again, since I have no background with working on IPS's plugin/modding; I thought I ask someone out there willing to quickly recreate this into a plugin that essentially provided the same option to the end users; randomize, store, display 5 dice rolls into each post. Perhaps beside

		<div class="ipsType_reset">
			<a href="http://www/?do=findComment&comment=" class="ipsType_blendLinks">Posted <time datetime="2017-08-021T00:00:00Z" title="08/21/2017 00:00  AM" data-short="1 y">August 21, 2017</time></a>
			<span class="ipsResponsive_hidePhone">
				
				
			</span>
		</div>

Thank you.

Link to comment
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...