Browser MMO Video #4

Location of the Videos
User avatar
kyraneth
Posts: 664
Joined: Thu Apr 23, 2009 2:56 pm

Re: Video #4

Post by kyraneth »

try clicking "help", then "about" in the browser, it should show you the version you are using. Also, if you are on xp, chances are you have IE6
Just FYI, the post is above, so stop looking down here and do something useful.

king noob. Nice.
Falken
Posts: 438
Joined: Fri May 08, 2009 8:03 pm

Re: Video #4

Post by Falken »

hallsofvallhalla wrote:what browser you using plus the version. IE5? IE6? Mozilla? ect..
Should not make a difference in this case as all PHP is processed on the server...so whatever browser that can read HTML should do fine.
--- Game Database ---
For all your game information needs!
Visit us at: http://www.gamedatabase.eu today!
vlaaduut
Posts: 3
Joined: Tue Jun 09, 2009 12:15 pm

Video #4

Post by vlaaduut »

Doesn't work

"could get a creature!"

this is the message, i've been looking for mistakes but i can't find them.
vlaaduut
Posts: 3
Joined: Tue Jun 09, 2009 12:15 pm

Re: Video #4

Post by vlaaduut »

sorry it was a space at the db...my bad :(
User avatar
Jesusfreak
Posts: 231
Joined: Mon Jun 08, 2009 1:43 pm

Re: Video #4

Post by Jesusfreak »

Ok, it looks like I have internet explorer 7.0.5730.11
That's ok, right? Oh and I have a Windows XP.
Image
_-= Official Noob Label -=_
For those with self esteem like mine =).
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #4

Post by hallsofvallhalla »

Falken wrote:
hallsofvallhalla wrote:what browser you using plus the version. IE5? IE6? Mozilla? ect..
Should not make a difference in this case as all PHP is processed on the server...so whatever browser that can read HTML should do fine.
yeah but the way php is interpreted by the browser after the server sends it does make a difference. I have had issues with ie5 and 6 not displaying things correctly directly from PHP.

The only way I can help you JF is if you export the database, simple just go to export then export as file and send me the .sql or take a screen shot of it. NAd then send me your php files. Just upload them to http://www.file-pasta.com/
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #4

Post by hallsofvallhalla »

hmm that all seems to be fine. let me look into this a little further....
User avatar
Noctrine
Posts: 928
Joined: Thu Apr 23, 2009 9:57 pm

Re: Video #4

Post by Noctrine »

If someone posts up one a downloadable link to an archive with the files in the right place I can find the error.

Edit: Also halls your attack script is missing an apostrophe.
Jesse Dorsey
ProjectANI - Lead Developer Person
http://about.me/jessedorsey
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #4

Post by hallsofvallhalla »

that would explain his error, but where is it missing?
User avatar
Noctrine
Posts: 928
Joined: Thu Apr 23, 2009 9:57 pm

Re: Video #4

Post by Noctrine »

Code: Select all

<?php
	include 'connect.php';
	
	$playerinfo="SELECT * from players where name='player1'";
	$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
	$playerinfo3=mysql_fetch_array($playerinfo2);

	if (isset($_GET['creature'])){
		$creature=$_GET['creature'];
		$creatureinfo="SELECT * from creatures where name = '$creature'";
		$creatureinfo2=mysql_query($creatureinfo) or die("could not get the creature you were fighting!");
		$creatureinfo3=mysql_fetch_array($creatureinfo2);
	}
	else	{
		echo "<a href='battle.php'>No Creature selected. Go Back!</a>";
		exit;
	}
	$playerhp = $playerinfo3['hpoints'];
	$playerattack = $playerinfo3['attack'];
	$playerdefense = $playerinfo3['defense'];

	$creature = $creatureinfo3['name'];
	$creaturehp = $creatureinfo3['hpoints'];
	$creatureattack = $creatureinfo3['attack'];
	$creaturedefense = $creatureinfo3['defense'];


	///////////////////////players turn////////////////////

	echo "<u> " . $playerinfo3['name'] . "'s Attack</u><br>";
	$playerattack = rand(1,20) + $playerattack;
	$creaturedefense = rand(1,20) + $creaturedefense;

	echo $playerinfo3['name'] . "'s Attack roll is " . $playerattack . "<br>";
	echo $creature . "'s defense roll is " . $creaturedefense. "<br>";

	if ($playerattack > $creaturedefense){
		echo $playerinfo3['name'] . " hits! <br>";
		$playerdamage = rand(1,6);
		$newcreaturehp = $creaturehp - $playerdamage;
		echo "For " . $playerdamage . " points of damage. <br>";
		if ($newcreaturehp < 1){
			echo "The " . $creature . " has been killed";

			$updatecreature="DELETE from creatures where name='$creature' limit 1";
			mysql_query($updatecreature) or die("Could not update creature");

			echo "<a href='battle.php'>Go Back</a>";
			exit;
		}
		
		$updatecreature="update creatures set hpoints='$newcreaturehp' where name='$creature' limit 1";
		mysql_query($updatecreature) or die("Could not update creature");
	}
	else{
		echo $playerinfo3['name'] . " misses!<br>";
	}
	//////////////////////creatures turn //////////////////

	echo "<u> " . $creature . "'s Attack</u><br>";
	$creatureattack = rand(1,20) + $creatureattack;
	$playerdefense = rand(1,20) + $playerdefense;

	echo $creature . "'s Attack roll is " . $creatureattack . "<br>";
	echo $playerinfo3['name'] . "'s defense roll is " . $playerdefense . "<br>";

	if ($creatureattack > $playerdefense){
		echo $creature . " hits! <br>";
		$creaturedamage = rand(1,6);
		$newplayerhp = $playerhp - $creaturedamage;
		echo "For " . $creaturedamage . " points of damage. <br>";
		if ($newplayerhp < 1){
			echo $playerinfo3['name'] . " has been killed<br>";
			echo "<a href='gameover.php>Continue";
			exit;
		}
		$updateplayer="update players set hpoints='$newplayerhp' where name='player1'";
		mysql_query($updateplayer) or die("Could not update player");
	}
	else{
		echo $creature . " misses!";
	}
	echo "<br><br><a href='battle.php?creature=$creature'>Battle Again!</a>";
?>

Closing tags is usually good also :p
Jesse Dorsey
ProjectANI - Lead Developer Person
http://about.me/jessedorsey
Post Reply

Return to “Older Browser MMO Videos”