Jump to content

some basic feature help


Recommended Posts

I was curious to know about for starters the pre/post_content.php and its capabilities. For example post_content, lets say I run any given module and to be more specific ill use combat, now can I use post_content to run an action like mugging another player or anything of that nature? If no, what would be the best course of action?

No another question I have is installer.php and install.marker. I tried using those and nothing happened, I tried adding those 2 files inside the actual module folder and module_folder/install/installer.php and install.marker, is there something else I should be doing?

And by golly I had something else I wanted to ask but by the time I got around to this I completely forgot

Link to comment
Share on other sites

1) auto_pre_content.php is run before showing the content. The difference between auto_pre_content (or post_content) and content, is that it will run anyhow, for any modules called. That allows to add code to be run all the time, yet either before showing the content or after. Before would be for example to adjusts the stats (for example to recover AP) and after to show the stats. In that way we solve one of the (many) problems of McCodes which do not show the stats right after an action.

For your question about mugging, you want to incorporate it within the combat? Otherwise it could be simply a normal module which let you rob another player.

2) Installer.php and installer.marker are not meant to be for modules. The install/installer.php will run as soon as it finds the installer.marker file in the same directory. Nothing else. If you need to run specific code for your module while installing, either "hack" it via a config key to run once, or... wait that I actually implement an optional installer.php in the module directory to be run. That was planned but as there was actually no real need for it so far, I simply postponed. Why would you need it? If you explain your need maybe I can actually help you more specifically.

Link to comment
Share on other sites

For the mugging feature i figured running a post content (which I assume is AFTER) I can run a module after a combat which in turn would adjust a stat. And crafted carefully you can make it do a multitude of things right? Maybe this is one of those things that im just not fully grasping the concept and it will.dawn on me a week from now lol.

For the installer, I thought that if the engine detected those files it executed the installer.php regardless but maybe its just for the default engine installation? I figure it would be nice to have as then you can run it and install maybe any swls needed, possible update a particular module for example maybe add a button to combat for mugging or whatever have you

Link to comment
Share on other sites

I don't see why you would need a marker for a module as beside some initial setup (like creating the sql) what would you need for a module? On the other side the marker file for the whole let you re-install the engine, for example to cleanup a mess you did.

For the mugging, I'm pretty sure your concept will not work. You cannot simply add it with a post content and hope it will be added in the combats.

Link to comment
Share on other sites

For the marker thats what I meant to do but for some reason the installer wouldnt trigger. and for the post content part of this discussion I guess I was just reading too much into it. I just figured maybe you can run like an if statement and add in a $_GET or 2 to retrieve an action of a module to only execute it when needed. I just figured it would be much easier to add some after affects to the combat module to get some desired outcomes if it worked the way I was thinking lol.

I guess ill try and figure something out.

Lets say for example you update one of your modules like combat or view player, do you replace the whole module, or do you just replace certain "lines or code" of that module. The reason I ask is because what if someone makes an addition of their own to a module does that get wiped out?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...