Jump to content

Roughly two or three questions.


Cless

Recommended Posts

Hello,

 

Not sure what the topic for this should be, so I named it Roughly two or three questions. Lol. Uhm, yeah. My questions are: How do you store Money? (I'm quite sure you wouldn't use a variable, as, variables are only temporary).

 

Also, how would you store equipment or items? (Like, on an RPG). My friend also wants to know how to store characters statistics, and giving how to give the character items. So, like, the item gets added to the player's inventory.

 

Thanks!

Link to comment
Share on other sites

Well I store money in a bank.  (not what you asking, so be more clear)

 

For the second part your talking a series of mySQL tables that are linked with primary keys.  However if you can't grasb this basic idea i don't think your quite ready to be making your own php game

Link to comment
Share on other sites

I mean... um, allowing the character to have money to buy items and such with, on the game.

 

Lol. I'm not making one yet, what I'm doing is practicing, and have learned most of the stuff, however, I needed to know some of these things. But, yeah, I mostly understand what you are talking about.

 

Thanks.

 

PS. Dark Nonique? Ah, yes. I know JoJo. An Administrator of TPF. Also, how could I use variables? Aren't variables only temporary? So, when the script ends, the money would be 0 again.

Link to comment
Share on other sites

Make some column in your SQL database, likely in the User table or however you have it. Make that your money column or w/e you use..

 

Make a variable that pulls the value from the SQL and displays it. And you can modify it depending on what they buy and such. So this way, even if the user leaves the site, their money still remains in the SQL.

Link to comment
Share on other sites

just tack on the money to the character data table then have a second table for items, maybe a third table for quest.  For the items give the items a link to users via a common key.  The trick is to store the lleast you can in the table and get away with.  Store the rest via functionality like switches/if/else/functions/loops.

 

If your game will involve a "map" system you will have a lot more issues because you will need to keep track of their position.  One suggestion is if you click to walk store their coordinates in a X,Y system and then you can splash out images based on their position but that involves tilling a huge map image HUGE

 

Its doable, but it will take a lot of coding and you have to watch optimization because you will be doing a great deal of querying

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.