home   |   contact us   |   sitemap   |   advertising Free Online Games
Free MMORPG

The Free MMORPG Games- Free MMORPG - P2P Games - Open Beta - Closed Beta - Browser Based - Non-English - Other Free Games - Top 50


Go Back   Onrpg Free MMORPG Forums > Development > Game Development
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 03-31-2007, 02:34 AM   #1 (permalink)
htmlgary
Marios's Mustache Wax
 
Join Date: Mar 2007
Posts: 7
Reputation: 10
MMOFaces Profile: None Yet
Talking Need Help on making a Text Based MMORPG

I Need help with making a Text Base MMORPG, i am looking to make one like www.gangbliss.com, www.don-city.com and www.gangparadise.com etc..

I know HMTL and PHP and the basics of MySQl and i also own www.tech-hosting.co.uk
But i dont know how to make a Text Based MMORPG could somebody either help me out or tell me.

you can also add me or email me at lilgazza2005@hotmail.com.
htmlgary is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-23-2007, 02:46 AM   #2 (permalink)
landavia
Cloud's Hair Spray
 
landavia's Avatar
 
Join Date: Jul 2006
Posts: 61
Reputation: 10
MMOFaces Profile: None Yet
Default

well.. based what u type here.. i have 1 suggestion for you..
never give up on a things..

same like me.. i waana create a game based-php. well to avoid spam.. i will give you my script.. enjoy and dont die trying

tes.php
Code:
<?
//same as tes1.php but use class
class Vegetable {

   var $edible;
   var $color;

   function Vegetable($edible, $color="green") 
   {
       $this->edible = $edible;
       $this->color = $color;
   }

   function is_edible() 
   {
       return $this->edible;
   }

   function what_color() 
   {
       return $this->color;
   }
   
} // end of class Vegetable


class game
{
	var $xO, $y0;
	var $x1, $y1;
	var $boxShow=5, $sizeBox=50;
	var $filename;
	var $statPos, $aMaxSize, $statMove;
	
	function game($filename){
		$this->filename=$filename;
	}
	
	function parse($nm, $val){
		$this->$nm = $val;	
	} 
	
	function show($nm){
		return $this->$nm;	
		
	}
	
	function openMap(){
		$handle = fopen($this->filename, "r");
		$contents = "";
		while (!feof($handle)) {
		 	$contents .= fread($handle, 500);
		 	
		}	
		
		$posX=1; $posY=1;
		for($i=0;$i<=strlen($contents);$i++){
			if(strtoupper( $contents[$i])){
				$statPos[$posX][$posY]=$contents[$i];	
			}else{
				$statPos[$posX][$posY]="";	
			}
		
			if($contents[$i] =="\n"){
				 $posY++;
				 $posX=1;
			 }else{
				$posX++;	 
				if($iMaxX <$posX) $iMaxX=$posX;
			 }		
		}
		
		$posY++;
		$this->aMapSize=array($iMaxX, $posY);
		
		$this->statPos=$statPos;
		
		fclose($handle);
	}
	
	function prevMap(){
		$statPos=$this->statPos;
		$txt.="<pre>";
		$aMapSize=$this->aMapSize;
		$iMaxX=$aMapSize[0]; $posY=$aMapSize[1];
		
		for($i=0;$i<$posY;$i++){
			
			for($j=0;$j<$iMaxX;$j++){
				if($statPos[$j][$i]==0 || $statPos[$j][$i]==""){
					$txt.="&nbsp;";
				}else{
					$txt.=$statPos[$j][$i];
				}
			}
			$txt.="\n";
		
		}
		$txt.="</pre>";	
		
		return $txt;
	}
	
	function mapSize(){
		$aMapSize=$this->aMapSize;
		$iMaxX=$aMapSize[0]; $posY=$aMapSize[1];
		
		$txt.="size = 0,0 - $iMaxX, $posY";
		$txt.= " = ". (1+$iMaxX)* (1+ $posY)." box";	
		
		return $txt;
	}
	
	function moveOnMap(){
		$aMapSize=$this->aMapSize;
		$iMaxX=$aMapSize[0]; $posY=$aMapSize[1];
		$statPos=$this->statPos;
		
		$txt.="<hr>$target";
		if(is_array($_POST) && $_POST[posY0]>0){
			foreach($_POST as $nm=>$val){
			//	$txt.="<br>$nm $val\n";	
				$$nm= $val;
			}
			//$txt.="<hr>pos array $posX0 $posY0";	
			$this->x0=$posX0; $this->y0=$posY0;
			$iPosX1=$posX0;
			$iPosY1=$posY0;
			
			if($target=="Atas"){
				$iPosY1=$posY0-1;	
			}	
			
			if($target=="Bawah"){
				$iPosY1=$posY0+1;	
			}
			
			if($target=="Kanan"){
				$iPosX1=$posX0+1;
				
			}	
			
			if($target=="Kiri"){
				$iPosX1=$posX0-1;
				
			}
			
			if($statPos[$iPosX1][$iPosY1]!=" "&&$statPos[$iPosX1][$iPosY1]!=0){
				$ulang=99; //ulang dipakai untuk random posisi	
			}else{
				$iPosX1=$posX0;
				$iPosY1=$posY0;
				$txtErr.="<h3>MELEWATI BATAS</h3>";//.$statPos[$iPosX1][$iPosY1];
				$ulang=99; //ulang dipakai untuk random posisi
			}
				
		}
		
		while($ulang<15){ 
				$iPosX1 = mt_rand(0, $iMaxX-1);
				$iPosY1 = mt_rand(0, $posY-1);
			 
			
			 $txt.="<br>$ulang posisi [ $iPosX1 ][ $iPosY1 ]".$statPos[$iPosX1][$iPosY1];
		 
			if($statPos[$iPosX1][$iPosY1]!=" "&&$statPos[$iPosX1][$iPosY1]!=0){
				$ulang=100;	
			}
			$ulang++;
		 
		} 
		 
		$txt.="<br>posisi [ $iPosX1 ][ $iPosY1 ]";
		//print $txt;exit();	
		$this->x1=$iPosX1; $this->y1=$iPosY1;
		return $txt;
	}
	
	function prevMap2(){
		$aMapSize=$this->aMapSize;
		$iMaxX=$aMapSize[0]; $posY=$aMapSize[1];
		$iPosX1=$this->x1; $iPosY1=$this->y1;		
		$statPos=$this->statPos;
		
		$txt.= $this->x1."<pre>";
		for($j=1;$j<$iMaxX;$j++){
			$i2=($j+10) %10;
			$txt.=$i2;	
		} 
		
		$txt.="<br>";// $iPosY1 $iPosX1<hr>";
		for($i=0;$i<$posY;$i++){
			
			for($j=0;$j<$iMaxX;$j++){
				
				if($i==$iPosY1 && $j==$iPosX1){
					$txt.="<b>X</b>";	
				}else{
					$txt.=$statPos[$j][$i];//."|$i=$iPosY1 $j=$iPosX1";
						
				}
			}
			//$txt.="\n";
		
		}
		$txt.="</pre>";
		$txt.="<br>posisi [ $iPosX1 ][ $iPosY1 ]";	
		
		//print $txt;
		return $txt;
	}
	
	function txt2colour(){
		$maxKotak=$this->boxShow;
		$aMapSize=$this->aMapSize;
		$iMaxX=$aMapSize[0]; $posY=$aMapSize[1];
		$iPosX1=$this->x1; $iPosY1=$this->y1;
		$statPos=$this->statPos;
		
		$width=$maxKotak*$this->sizeBox;
		$txt2.="\n <table border=0 width=".$width." bgcolor=#FFFFCC>";
		
		for($i=1;$i<$maxKotak;$i++){
			$txt2.="\n<tr height=50>";
			for($j=1;$j<$maxKotak;$j++){
				
				$x=($iPosX1-($maxKotak-1)/2)+$j;
				$y=($iPosY1-($maxKotak-1)/2)+$i;
				if($statPos[$x][$y]==1){ 
					$bgcolor="00ffff";
				}elseif($statPos[$x][$y]==2){ 
					$bgcolor="12FF12";
				}elseif($statPos[$x][$y]==3){ 
					$bgcolor="00EF45";			
				}elseif($statPos[$x][$y]==4){ 
					$bgcolor="00DD00";
				}elseif($statPos[$x][$y]==5){ 	
					$bgcolor="FFFF00";	
				}else{
					$bgcolor="";
				}
				$show="";
				if($y==$iPosY1 && $x==$iPosX1){
					$show="<center>you</center>";	
				} 
				$txt2.="\n<td width=50 ";
				if($bgcolor!="") $txt2.="bgcolor=#$bgcolor";
				$txt2.=">$show &nbsp;</td>";
			}	
			$txt2.="\n</tr>";
		}
		$txt2.="\n</table>";
		
		return $txt2;	
	}
	
	function checkPos(){
		$maxKotak=$this->boxShow;
		$aMapSize=$this->aMapSize;
		$iMaxX=$aMapSize[0]; $posY=$aMapSize[1];
		$iPosX1=$this->x1; $iPosY1=$this->y1;
		$statPos=$this->statPos;	
		
		$statYou=$statPos[$iPosX1][$iPosY1];
		$statYouUp=$statYou+1; $statYouDown=$statYou-1;
		if($statYouDown<1) $statYouDown=1; 
		//north??
		if($statPos[$iPosX1][$iPosY1-1]==$statYouUp || 
			$statPos[$iPosX1][$iPosY1-1]==$statYouDown||
			$statPos[$iPosX1][$iPosY1-1]==$statYou){
			$statMove["N"]=true;
//			print  $statPos[$iPosX1][$iPosY1-1]."==$statYouUp || ".$statPos[$iPosX1][$iPosY1-1]."==$statYouDown";	
		}
		
		if($statPos[$iPosX1][$iPosY1+1]==$statYouUp || 
			$statPos[$iPosX1][$iPosY1+1]==$statYouDown||
			$statPos[$iPosX1][$iPosY1+1]==$statYou){
			$statMove["S"]=true;	
		}
		if($statPos[$iPosX1-1][$iPosY1]==$statYouUp || 
			$statPos[$iPosX1-1][$iPosY1]==$statYouDown||
			$statPos[$iPosX1-1][$iPosY1]==$statYou){
			$statMove["W"]=true;	
		}
		if($statPos[$iPosX1+1][$iPosY1]==$statYouUp || 
			$statPos[$iPosX1+1][$iPosY1]==$statYouDown||
			$statPos[$iPosX1+1][$iPosY1]==$statYou){
			$statMove["E"]=true;	
		}
		
		$this->statMove=$statMove;						
		
	}
	
	function button(){
		$txt='<form   method="post" >';
		$iPosX1=$this->x1; $iPosY1=$this->y1;
		$statMove=$this->statMove;
		
		$txt.="<input type=hidden value=$iPosY1 name=posY0>
		<input type=hidden value=$iPosX1 name=posX0>";
		$txt.="<input type=hidden value=".$this->filename." name=map>";
		
		if($statMove[N]==true){
			$inpButton[n]='<input type="submit" value="Atas" name=target>';
		}
		if($statMove[S]==true){
			$inpButton[s]='<input type="submit" value="Bawah" name=target>';
		}
		
		if($statMove[W]==true){
			$inpButton[w]='<input type="submit" value="Kiri" name=target>';
		}
		if($statMove[E]==true){
			$inpButton[e]='<input type="submit" value="Kanan" name=target>';
		}
		
				
		$txt.='	
			<table width="50" border="1" summary="">
			<tr>
				<td align="center" valign="middle" colspan="2">'.$inpButton[n].
				'&nbsp;</td>
			</tr>
			<tr>
				<td valign="middle">'.$inpButton[w].
				'&nbsp;</td>
				<td valign="middle">'.$inpButton[e].
				'&nbsp;</td>
			</tr>
			<tr>
				<td align="center" valign="middle" colspan="2">'.$inpButton[s].
				'&nbsp;</td>
			</tr>
		</table>
		</form>';
		return $txt;
	}
 
}

class gameChar extends game {
	var $uX, $uY;
	
	function checkScript(){
		$filename=substr($this->filename,0,-4).".php";		
		$userX=$this->x1;
		$userY=$this->y1;
		include($filename);
		
			
	}
	
}

$cGame = new gameChar("map1.txt");
if($_POST[map]){
	$cGame->parse("filename", $_POST[map]);
}
/*if($_POST){
	foreach($_POST as $nm=>$val){
		$txt.="<br>$nm $val\n";	
		$$nm= $val;
	}	
}
print $txt;
*/
$cGame->openMap();
$cGame->prevMap();
$cGame->moveOnMap();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Created on: 19/04/2007 -->
<head>
<title></title>
</head>
<body><?

  $cGame->checkScript();
print $cGame->txt2colour();
$cGame->checkPos();
print $cGame->Button();

print $cGame->prevMap2();

?>
</body>
</html>
map1.txt
Code:
111112211111
111111111111         1111111111
      113321     11111111221113
      11331111111111311113331121   111112211111
112232112111         11151411111      321
      113321     11111111221113      22
      1133111111111131111333112111112333333
                                     111111111111111121111111
                  111111     11111221221111
                  111111     11111211211111
                  111111     11111111111111
                  1112423243211111121111111
      111111     11111221221111         1131211121
      111111     11111211211111          122111111
      111111     11111111111111            112111
      111112211111                           121121
111111111111         1111111111              12121212
      113311     11111111221113              12312
      11331111111111311113331121          1231213321
      11111111222112        123132133      11111111121111111
      111111                    11111221221111212
      111111                     11111211211111
      111111                       11111111111111
map1.php
Code:
<?
//userX userY

if(
  $userX==1 && 
  $userY==5){
	$this->filename="map2.txt";
	//20,48	
	$this->x1=38;
	$this->y1=6;
	$this->openMap();
	//print $this->prevMap();
	//$this->prevMap2();
}
?>
map2.txt
Code:
     2211111
      111111         1111111111
      113321     11111111221113
      11331111111111311113331121   111112211111
        2111         11151411111      321
      113321     11111111221113      22
      1133111111111131111333112111112333333
                                     111111111111111121111111
                  111111     11111221221111
                  111111     11111211211111
                  111111     11111111111111
                  1112423243211111121111111
      111111     11111221221111         1131211121
      111111     11111211211111          122111111
      1   11     11111111111111            112111
      111112211111                           121121
111111111111         1111111111              12121212
      113311     11111111221113              12312
      11 3 111111111311113331121          1231213321
      11   111222112        123132133      11111111121111111
      111111                    11111221221111212
      111111                     11111211211111
        111111                       11111111111111
     2211111
      111111         1111111111
      113321     11111111221113
      11331111111111311113331121   111112211111
        2111         11151411111      321
      113321     11111111221113      22
      1133111111111131111333112111112333333
                                     11332211111111111121111111
                  111111     11111221221111
                  111111     11111211211111
                  111111     11111111111111
                  1112423243211111121111111
      111111     11111221221111         1131211121
      111111     11111211211111          122111111
      1   11     11111111111111            112111
      111112211111                           121121
111111111111         1111111111              12121212
      113311     11111111221113              12312
      11 3 111111111311113331121          1231213321
      11   111222112        123132133      11111111121111111
      111111                    11111221221111212
      111111                     11111211211111
      111111                       11111111111111
map2.php is blank only.
there someone can help me.. in map1.php.. i want to use this step
Code:
<map name=map1>
    <position x=1 y=3>
    move("map2.txt", 38,6);
	</position>
</map>
hmm.. that's xml actualy.. but i just concern about create this like rpgmaker..

Last edited by landavia : 04-23-2007 at 03:05 AM. Reason: the post are tooo long.. is fine type whole?
landavia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:06 PM.

Forums Section List
Main Category Free Games Online Games Upcoming Games Online Games Upcoming Games
General Free MMORPG Fiesta Online    Maple Story Guides Trickster DOMO - Dream of Mirror Online
RolePlaying Free MMO & MMOFPS Conquer Online    Maple Story Buy/Sell/Trade WarRock Online Seal Online
Newbie Zone Korean/Foreign Games DragonGem Lunia World of Warcraft Age of Armor
  Browser/MUDs FlyFF Ragnarok Online Other Games Exteel
  Single Player RPGs Ghost Online Rakion    Rappelz Infinity
  Free MMORPG Requests Guildwars Runescape    Final Fantasy XI Cabal Online
    Gunz Online Scions of Fate (YulGang)    Goonzu Online Granado Espada
    Maple Story Silkroad    Gunbound Nostale



Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8
Onrpg, Copyright ©2003-2007, BlueCastle Media

Copyright © 2004-2007 BlueCastle Media