Thread: Major Additions - Play By Post Gaming Core
View Single Post
  #25  
Old 01-31-2010, 10:37 AM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Writing a dungeons and dragons mod would take a long time. D&D is also very copywrited so i'd not be able to release a direct copy.

My 3.8 forum uses a rpg mod based on the 3.0 rpg integration hack; I'm considering creating something based around that as an addon but thats not likely to happen for some time.

I've uploaded a skeleton plugin file. Things you need to do:

1. rename the directory they are in to your plugin name eg rpgsystem
2. open the two files and change the classnames to match the directory name eg rpgsystemPlugin and rpgsystemAdmin
3. insert a db row into pbpg_plugins containing rpgsystem as the dir and a friendly name for title eg RPG System.
4. Create a new product to go with the plugin for the purpose of holding templates phrases etc

The admin file is fairly simple to understand, I suggest you just take a look at one of my mods for how to make that work.

The plugin file contains three functions:

A constructor which is passed in the config settings saved by the admin. The default constructor will work but you may want to set defaults for values that haven't been set and setup the state of the game (eg the chess mod initiallises the board with the pieces in their starting places)

A public function parsePost it takes one argument the post array as fetched by vbulletin from the db, its called once for each post in the thread. It should essentially behaive as a state machine, changing the object state based on the contents of the post; you can again look at my mods on for examples of how I do this.

An output function, this function is called at the end of processing and its return value is used to replace the postbits part of a thread display. (this means you don't need to worry about navbar, footer etc) I used a template based on the postbit template for my UI's but this is totally upto you. If instead you want to stick a flash video in there showing the two combattants mauling each other, thats upto you.

I am tidying up the interfaces so the above information may change in a next release; the only change i'm considering at the moment is adding an ajaxOutput function or a parameter to the output function for returning content for ajax display but there may be other things based on bugs that need changing.
Attached Files
File Type: zip skeleton.zip (1.0 KB, 7 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02413 seconds
  • Memory Usage 1,782KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete