Hi all..
I just posted a module idea I'm using in the RTS framework and I think this can be helpfull also for the rpg engine.
"Jailing a user" at http://groups.drupal.org/node/8628
To avoid cross posing, a resume of the module idea is to jail the user into a page untill he completes an operation, but leave the user free enough to check some uris (documentation, faq, forum). Any other uri not "allowed" will redirect the user again to it's incomplete operation.
I guess in RPG games it can be used to avoid trap-cheating and hidden exits.. Just as an example, if a fight begins, the user is jailed in the battle and can't go on the run, and if it's seriously hurt, the user can't do anything else but watch..
A real example how I'm using this module is described in that post, but not too deeply.. In Ncounter! operations can be done if you have energy in the planet, and one of the attacks can just hit the energy plant. In that case, everything shutdown.. the communications centre (AKA the private message module) should not work, neither the building operations.. While the energy is low I keep the user jailed in a "booting up.." screen, untill there's enough energy to keep playing (it's, I free the user). While this happends, the user should be able to read the documentation in any case, or do other operations, like request for help, or ...
I can create a contrib for this, but it should be improved so other (out of games) usages could be covered also.
thoughs?
Comments
hook_init
It's an interesting idea. Not sure it's needed for the RPG module -- all user calls in RPG go through the /rpg/play URL, so it's easy enough to redirect that if needed. In fact, the demo site already does this: http://drupalrpg.org -- during character registration, you can't do anything else till you've answered a question. I'm also turning that into multipage forms at http://spindowners.com (though character registration there isn't open yet).
But I could see that being a useful helper module for some developers/admins. Just have a block with allowed URL's or something, and redirect everything else if a certain criteria hasn't yet been met.. That could easily be accomplished with a hook_init call.
Aaron Winborn
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes
Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic
hook_rpg_play
In fact, with the RPG module, hook_rpg_play does this. The developer just needs to add a drupal_goto from that if they want to redirect players.
Aaron Winborn
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes
Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic
yess..
as you said, it's a hook_init trick.
I can't do control as you do. I'm using nodes and normal drupal hooks so I need another element to control requiered workflows in the game.
I'll do some brainstorm and if I can't find more uses will left just for internal purposes as a helper in drtsg instead of contrib module.
Thanks Aaron!