Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Thursday, March 17, 2011

The code for your Inventory using PHP

I have been browsing the inter webs and have come across a code for inventory...a simple place to begin gathering a larger picture...

$invsize = 10;
if (mysql_num_rows(mysql_query("SELECT * FROM INVENTORY WHERE user=USERID")) < $invsize){
echo 'You still have inventory space';
}
else {
echo 'Your inventory is full!';
}

That will hopefully help in the near future....

And if you want to get an item from a users inventory...just query the USERID up like this
php
mysql_query("SELECT * FROM items WHERE userid=1515");

A skill for the rogues perhaps?

The life of the Ravaged...A look into PHP coding

Its St. Patty's day and we all know what that means...drunken idiots stumbling and bumbling their way through the streets. I am reminded of The Boondock Saints "Truuu laa ruu laa luuu raa" you remember its because the mafia guys who were attacked found themselves in the wrong alley. 

Anyhow as it has been said earlier progress is a slow process but with the help from those who want to see the ritual unfold...I will continue on the path and get ever closer to my goal. It seems I am now interested in learning PHP coding also seeing as how it will allow me to run my program on my computer for other people to access.

I don't know much about PHP but I will not stop my search....it seems I have found a place to start

Learning PHP tutorial

Perhaps if I study this for a while I may learn something of use....
  • PHP is a server side language
  • Runs on your web server
  • No compatibility issues
  • Becoming widely used
Okay and as we continue through the tutorial... Why bother with PHP?
  • Opens possibilities for the user to custom make scrips
  • Better "interactive" scrips
  • More professional and clean website
Okay thats great but... What do I need to get started?
  • Not much at all besides motivation
  • A text editor 
  • A web host that allows PHP (its a free download)
  • Starting is easy...
And now we get to the first ever code. It seems there are three basic set of tags that can be used to start and end a line of code....I found this example at the tutorial first mentioned...

<?
PHP Code In Here
?>

<?php
PHP Code In Here
php?>

<script language="php">
PHP Code In Here
</script>

Each set of these tags works the same so it will be beneficial to remember them.
My first ever script is a single line "phpinfo();"  This is a simple code that will tell the server to print out a table of information about the server...nothing very interesting.

Note: The semicolon at the end of the line. All lines will end with a semicolon otherwise there will be errors

---End First Lesson--- 

Tuesday, March 15, 2011

Steps in the right direction....gathering information on Text Based games

If you want to develop a MMO, you need to commit to it. Even a text-based game can require a considerable amount of code, especially if you really want to grab the gamers attention and create an addicting and memorable gaming experience.

Roughly, you can have anywhere between 30-100+ files for a descent scale MMO (depends on what type of features are available in your game), with each file containing anywhere between 300-1000+ lines of code. So again, you need to committ to it, you need to put a lot of time and effort towards the project if you want it to be successful.
A hint I learned while searching the inter web: Don't try to make the "bestest-ever" in your first project, you'll never finish!

In terms of programming languages, PHP is probably the best choice for a text-based MMO. It has a small learning curve and there are all sorts of resources online. Since I have never coded in PHP before, I suggest using a free bulletin board like PhpBB and start installing custom mods. This will give you a feel of how to do PHP coding. Once you are a bit more confident, you can install a forum game mod like ADR (Advanced Dungeons & Rabbits) which will introduce you to the world of MMO text-based gaming.