Advertisement:

Author Topic: Developing mods  (Read 612 times)

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Developing mods
« on: February 22, 2018, 01:22:31 PM »
Hello,

I have some php/mysql knowledge and I am looking to develop mods. I had a look around at the topics mentioned in the sticky topic of this board, such as Package SDK, anyone? etc, but I still did not understand the process of developing mods. Do I need to install that and develop it from the admin panel, or do I have to copy the xml files and enter there the code? Can someone dumb it down for me please?
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Suki

  • Kaizoku Jotei
  • On Hiatus
  • SMF Super Hero
  • *
  • Posts: 15,325
  • I don't really come from outer space
    • MissAllSunday on GitHub
    • SMF mods
Re: Developing mods
« Reply #1 on: February 22, 2018, 01:33:38 PM »
Almost all modders I know started out by looking at other people's mods. So best place to start is actually "borrow" someone elses mod and study it to see what does what.

Very broadly, Package SDK is just a set of definitions your xml can have, thats pretty much it, it tells you what you can do and how you can use it.

To start developing mod you don't need to install anything other than perhaps a local copy of SMF where your changes are going to be applied, once you have those changes you can put them into your .xml as instructions replace with/ add after/ add before. etc.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Developing mods
« Reply #2 on: February 22, 2018, 01:45:31 PM »
Yes, I did that. I downloaded a couple of mods and looked inside them. But I did not know if I had to install the package sdk and enter the code from my admin panel and then the system was going to write it automatically to the xml file. Anyways, many thanks again for your help.
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Suki

  • Kaizoku Jotei
  • On Hiatus
  • SMF Super Hero
  • *
  • Posts: 15,325
  • I don't really come from outer space
    • MissAllSunday on GitHub
    • SMF mods
Re: Developing mods
« Reply #3 on: February 22, 2018, 01:53:56 PM »
No, you have to manually fill up your xml file with whatever instructions your mod does.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Developing mods
« Reply #4 on: February 22, 2018, 01:59:23 PM »
No, you have to manually fill up your xml file with whatever instructions your mod does.

From what I can gather till now, the modification package should contain 2 files, one is the info file and the other the file that contains the actual code. That is for simple mods that do not manipulate the database by adding custom stuff such as tables or columns. Am I right in my assumption?
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Suki

  • Kaizoku Jotei
  • On Hiatus
  • SMF Super Hero
  • *
  • Posts: 15,325
  • I don't really come from outer space
    • MissAllSunday on GitHub
    • SMF mods
Re: Developing mods
« Reply #5 on: February 22, 2018, 02:04:47 PM »
Yes, thats correct, package.info.xml contains, well, info about your mod such as your mod's version, author, SMF version compatible with, un/install instructions, etc.

A second xml file (or as many as you need) is used to "store" your code changes and how those changes are going to be applied.

Bigger mods usually need to alter the DB, in this cases, a database.php file is usually used, it contains PHP code for directly intereact with the DB, create/alter tables, inserts, deletes, etc.

Theres also the whole concept of "hooks" which can help you to reduce code edits but it might be better for you to get used to how code edits works and then move on to using hooks.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Developing mods
« Reply #6 on: February 22, 2018, 02:12:44 PM »
Yes, thats correct, package.info.xml contains, well, info about your mod such as your mod's version, author, SMF version compatible with, un/install instructions, etc.

A second xml file (or as many as you need) is used to "store" your code changes and how those changes are going to be applied.

Bigger mods usually need to alter the DB, in this cases, a database.php file is usually used, it contains PHP code for directly intereact with the DB, create/alter tables, inserts, deletes, etc.

Theres also the whole concept of "hooks" which can help you to reduce code edits but it might be better for you to get used to how code edits works and then move on to using hooks.

The more I am looking around, the more it is starting to make sense. The sdk package files are well doccumented with comments, and looking the at the code of other mods the pieces are starting to fall into place.

What are these hooks that you speak of btw? Can you please post a link to it?
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,737
Re: Developing mods
« Reply #7 on: February 22, 2018, 02:13:51 PM »

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
It's fast, it's furious, it's generalcartalk.com

Check out my mods

Offline doug_ips

  • Jr. Member
  • **
  • Posts: 141
    • generalcartalk.com
Re: Developing mods
« Reply #9 on: February 27, 2018, 11:09:16 AM »
I just submited my first mod. I am so exited. I am surprised as to how easy and smooth it went. Smf simply rocks :)
It's fast, it's furious, it's generalcartalk.com

Check out my mods