Items and travel

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
dave3460
Posts: 117
Joined: Wed Jul 01, 2009 2:13 pm

Items and travel

Post by dave3460 »

I guys and girls Not sure if this has be asked before?

My question is what is the best was to have a item used for travel i.e boats/ creatures to ride
which way should i be looking at this issue ?
as for coding i have not really done any on this feature yet just after ideas on best way to look at it.

the boat/sailing part i am hoping to if item is equipped then you can sail if not you could swim i suppose which is another way it could be looked at.

Thanks for any help you can give
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: Items and travel

Post by Callan S. »

Is this in a text based browser game?

It depends on how you do traveling - do players just go from A to B or do they actually travel on a grid map while on the sea?

Do you want them to keep their boat at a port, or can they carry their boat around in their pocket? :)

If a port, you could just check if they have a boat at this port, then if so allow them to travel.
dave3460
Posts: 117
Joined: Wed Jul 01, 2009 2:13 pm

Re: Items and travel

Post by dave3460 »

Is this in a text based browser game?

semi graphical and text

It depends on how you do traveling - do players just go from A to B or do they actually travel on a grid map while on the sea?

yes would be from port to port (so location would be held in db)

Do you want them to keep their boat at a port, or can they carry their boat around in their pocket? :)

Both have a port for players without boats but also be able to build boats thats they can use on water maybe even fish or dive from it

If a port, you could just check if they have a boat at this port, then if so allow them to travel.

yes thats also a way am looking at.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Items and travel

Post by Jackolantern »

If you want them to actually move around the sea in the boat, then you would probably just want to do a check whenever they are in a water area to make sure they have the boat (probably as a flag in the database). If they don't have a boat, they either drown and die, or automatically swim back to shore.
The indelible lord of tl;dr
Klown
Posts: 89
Joined: Tue Feb 22, 2011 5:59 am

Re: Items and travel

Post by Klown »

Hi Dave!

I have a game similar - space based. So when my guys travel from planet to planet, I setup a table which holds the mission information, this includes number of ships of each type of ship, time they departed, time they should arrive, and other pertinent information.

I suggest possibly adding a table or a column to one of your already created tables which shows the players boat status, for example, you can setup your table like follows:

id, name, location, mount

where the column "mount" can either be a simple: "1" or "0" for a yes there is a boat, or no there is not a boat. or you could have this store the type of mount: swim, boat, car, horse, walk, none.

You can make this as simple as calling an "if" statement in the code to determine what mode of travel the player has the ability to perform, or you can make it very complex by adding new tables to give the speed of each type of transport, the possibilities are only limited by your imagination!

Good luck and I hope this helps!
if( $myGames != "Crap" ) {
  • please_donate( $money );
} else {
  • just_enjoy();
}
dave3460
Posts: 117
Joined: Wed Jul 01, 2009 2:13 pm

Re: Items and travel

Post by dave3460 »

Thanks all
Klown that makes sense will try that.
Post Reply

Return to “Beginner Help and Support”