game - adding items with high customization possibilities
Posted: Mon Jun 11, 2007 1:45 pm
Hello,
I'm creating an browser based RPG game. I think you've played them at least once and you know there are things like spells, sometimes various abilities and professions. Here's my problem:
I'm going to create lots of spells and all of them will do something different than others. I want to make them very flexible. I've decided to write a block of PHP code about what each spell will have to do and put these block into MySQL database, so it's easier to edit them later in Admin panel of the game (won't have to edit php files and upload them, saves lots of time). Now what I need to do is to take that code block from mysql database and execute it so it does what's written in the block. How can I do that?
If I add more than 100 spells (many classes to choose from with lots of spells) to a php file with code blocks for each spell, the file would be huge and I want to add a spell I would need to edit that file and then upload it.
I just want to make my script flexible so that spells, professions and abilities could be customizable by php language. You're very welcome to offer any ideas how can I do that even if it's not like I thought. Maybe making a big file with functions for each spell is a better idea, I don't know... I don't have much experience with PHP (about a half a year) so I'm asking for your help.
Thanks for any suggestions!
I'm creating an browser based RPG game. I think you've played them at least once and you know there are things like spells, sometimes various abilities and professions. Here's my problem:
I'm going to create lots of spells and all of them will do something different than others. I want to make them very flexible. I've decided to write a block of PHP code about what each spell will have to do and put these block into MySQL database, so it's easier to edit them later in Admin panel of the game (won't have to edit php files and upload them, saves lots of time). Now what I need to do is to take that code block from mysql database and execute it so it does what's written in the block. How can I do that?
If I add more than 100 spells (many classes to choose from with lots of spells) to a php file with code blocks for each spell, the file would be huge and I want to add a spell I would need to edit that file and then upload it.
I just want to make my script flexible so that spells, professions and abilities could be customizable by php language. You're very welcome to offer any ideas how can I do that even if it's not like I thought. Maybe making a big file with functions for each spell is a better idea, I don't know... I don't have much experience with PHP (about a half a year) so I'm asking for your help.
Thanks for any suggestions!