Browser MMO Video #9

Location of the Videos
GrInd3r
Posts: 66
Joined: Mon Jul 13, 2009 10:34 pm

Re: Video #9

Post by GrInd3r »

try to google the errors, Undefined Index Of and look and see what causes the problem

In this case the Variables Attack defense etc... are not found make sure that you dont have them Capitalized or Camel-Case

Defense and defense are different. when calling a variable and will throw you exceptions like the one you have. also its good to turn error reporting off and goto the wamp icon left click goto php->php error log that way it dosnt distort your page
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #9

Post by hallsofvallhalla »

in the above code you havent fixed it. Its still wrong, the capitalization is wrong. So I can't troubleshoot it until that is fixed. If it is fixed then i need to see the new code.

you have defense and then defence
GrInd3r
Posts: 66
Joined: Mon Jul 13, 2009 10:34 pm

Re: Video #9

Post by GrInd3r »

lol, Halls where is that sql dump >< So I can work on it, want to throw some ajax into the game
fleaky
Posts: 27
Joined: Sun Jul 05, 2009 11:57 pm

Re: Video #9

Post by fleaky »

Heyyaa fixed all of them now, errrmmm you no use item, well... i can't i use it but it does not add anything what so ever and plus i can exit a fight whenever and also i can buy unlimited amount of stuff it doesn't count the stat price or whatever it should count for.

any sugguestions???

here is useitem.php
and by the way did we need a useitem in mysql table?? like players/creatures/store etc cause i havent got one.

Code: Select all

<?php

include_once 'connect.php';
session_start();

if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
  exit;
}

$creature=$_GET['creature'];

$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);

$playerid = $playerinfo3['id'];

$counter = 0;
echo "<small>";
      print "<center>";
      print "<table border='0' width='70%' cellspacing='20'>";
      print "<tr><td width='25%' valign='top'>";
      print "</td>";
      print "<td valign='top' width='75%'>";
      $invinfo="SELECT * from inventory where id='$playerid'";
      $invinfo2=mysql_query($invinfo) or die("could not select player inventory");
      print "<table border='1' bordercolor='white' bgcolor='#ffffff'>";
      print "<tr><td>Name<font color='ffffff'>________________</font></td><td>Stat<font color='ffffff'>______</td><td>Stat Add<font color='ffffff'>______</td><td>Type<font color='ffffff'>______</td><td><font color='ffffff'>________________</td></tr>";
      while($invinfo3=mysql_fetch_array($invinfo2))
      {
      print "<tr><td>$invinfo3[name]</td><td>$invinfo3[stats]</td><td>$invinfo3[statadd]</td><td>$invinfo3[type]</td><td><A href='battle.php?randid=$invinfo3[randid]&creature=$creature'>Use Item</td></tr>";
       $counter = 1;

      }

      print "</table>";
      print "</td></tr></table>";
      print "</center>";
       echo "</small>";

      if ($counter == 0)
      {
            echo "<center>You have Nothing in your inventory!<br>";
            echo "<a href='battle.php?creature=$creature'>Go Back</center>";
            exit;
      }

    echo "<center><a href='battle.php?creature=$creature'>NeverMind</center>";

    ?>
fleaky
Posts: 27
Joined: Sun Jul 05, 2009 11:57 pm

Re: Video #9

Post by fleaky »

Anyone got a result yet?
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: Video #9

Post by darspire »

so when is video 10 coming out?
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
centulo
Posts: 1
Joined: Wed Jul 29, 2009 1:22 am

Re: Video #9

Post by centulo »

Hello MMO Makers, :D

Can someone send me all the .php, .css and the DB files? so I can begin with the next video? I lost all my files :cry:

Greetz!
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #9

Post by hallsofvallhalla »

i am zipping all the files up shortly and should have them up within a hour, along with the next video.
princezane
Posts: 11
Joined: Sun Nov 29, 2009 3:35 am

Re: Video #9

Post by princezane »

fleaky wrote:errrmmm you no use item, well... i can't i use it but it does not add anything what so ever
Probably a missing or typo'd variable somewhere, or maybe accidentally skipped a line somewhere. Haven't bothered looking at your code to be honest, just a guess (still trying to sort out a bug in mine, just saw this post while I was looking through the forum). My items are working ok, so I know the source code is working, I suggest renaming your file and copying halls' to test on, if it works then you know you are missing something and need to comb through it line-by-line or character-by-character if need be... I've had to do it once or twice because of a silly missed ' or ; makes you feel stupid when you spend an hour or 2 digging for one silly mistake like that
and plus i can exit a fight whenever
Yup, that's how it's designed so far. The game hasn't gotten complex enough yet to lock you into battle that you can't escape from to my knowledge (i.e. there isn't a "flee" or "escape" type of move)
and also i can buy unlimited amount of stuff it doesn't count the stat price or whatever it should count for.
Yeah, we haven't gotten to the point of adding loot/gold, so everything is just for display purposes for now until we get there
any sugguestions???
Patience grasshopper :mrgreen:
User avatar
Zerk
Posts: 58
Joined: Wed Jan 20, 2010 2:59 am

Re: Video #9

Post by Zerk »

At this point all I get is "could not register"

I realize this comes from the following line:

Code: Select all

$SQL = "INSERT into player(name, password, email, level, exper, attack, defense, hpoints, maxhp, spoints, maxspoints) VALUES ('$player','$password','$email','1','0','$classquery3[attack]','$classquery3[defense]','$classquery3[hpoints]','$classquery3[hpoints]','$classquery3[spoints]','$classquery3[spoints]')";
mysql_query($SQL) or die("could not register");
but I can't figure out what I have wrong. I've checked my data base for correctness (looks same as halls') many times. If there is nothing wrong with this script, why will it not register?
Coding - Unity3d JS, PHP, and small amount of C#.
Art stuff - GIMP, Blender
Post Reply

Return to “Older Browser MMO Videos”