Browser MMO Video #10
-
- Posts: 165
- Joined: Tue Oct 13, 2009 4:22 pm
Re: Video#10
clicked on the zip and go
:Not Found
The requested URL /file/tutorial.zip was not found on this server.:
lol
:Not Found
The requested URL /file/tutorial.zip was not found on this server.:
lol
Coding - Unity3d JS, PHP, and small amount of C#.
Art stuff - GIMP, Blender
Art stuff - GIMP, Blender
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#10
Yeah, there was kind of an issue where any files on File-Pasta were lost. I suppose they need to be re-upped.
The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#10
just keep going through the videos, you dont need the source yet until video 14 or so.
Re: Video#10
This is what I decided to do after vid 11...I was going to fast; I wanted to get a simple game running (I don't know why, though). I ended up getting lostJackolantern wrote:I would suggest that instead of wanting to get to the next video as soon as possible, it is a good idea for people to experiment with what was just shown in the current video. This way, you will be much better prepared for modding the game to make it your own. Try to link existing systems, upgrade what was just shown to add new features (share them if you make a nice update!), and on and on. Each video could probably offer hours of experimenting to make sure you comprehend the PHP being shown (for new PHPers), or the design concepts (for experienced PHPers, but those new to PHP MMO development).

Went back and did vids 3-10 SLOWLY and messed around with it.^^ lol
Coding - Unity3d JS, PHP, and small amount of C#.
Art stuff - GIMP, Blender
Art stuff - GIMP, Blender
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#10
Exactly. "Messing around with it" is the operative phrase there. "Getting ahead" of the videos will only cause confusion if you aren't already a seasoned PHP coder.Zerk wrote:This is what I decided to do after vid 11...I was going to fast; I wanted to get a simple game running (I don't know why, though). I ended up getting lostJackolantern wrote:I would suggest that instead of wanting to get to the next video as soon as possible, it is a good idea for people to experiment with what was just shown in the current video. This way, you will be much better prepared for modding the game to make it your own. Try to link existing systems, upgrade what was just shown to add new features (share them if you make a nice update!), and on and on. Each video could probably offer hours of experimenting to make sure you comprehend the PHP being shown (for new PHPers), or the design concepts (for experienced PHPers, but those new to PHP MMO development).![]()
Went back and did vids 3-10 SLOWLY and messed around with it.^^ lol
The indelible lord of tl;dr
-
- Posts: 9
- Joined: Sat May 05, 2012 2:04 pm
Re: Video#10
The code link isnt working anymore :S, wont work on video 11 either, havent checked the ones after that, but im having a problem with my buyitem.php
this is the code:
and i keep getting this error message:
Parse error: syntax error, unexpected T_ECHO in C:\wamp\www\game\buyitem.php on line 42
i followed the video exactly and im not sure what ive done...
please help ASAP
this is the code:
Code: Select all
<?php
include_once 'connect.php';
session_start();
///new for video 8/////////////
include_once 'logo.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<div id="login2" div align="center">
<?php
///////////////////////////////////
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
$randid=$_GET['randid'];
$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'];
$iteminfo="SELECT * from store where randid='$randid'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
if ($playerinfo3['gold'] < $iteminfo3['price']);
(
echo"You do not have enough gold for this purchase!";
echo"<center><a href='index.php'>Go Back</center>";
exit;
)
$name = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
$randid2 = rand(1000,999999999);
$itembought = "INSERT into inventory(id, name, stats, statadd, randid,type) VALUES ('$playerid','$name','$stats','$statadd','$randid2','$type')";
mysql_query($itembought) or die("could not insert item into backpack");
$updateplayer="update players set gold=gold-='$iteminfo3[price]' where name='$player'";
mysql_query($updateplayer) or die("Could not update player");
echo $name . " Purchased";
echo "<center><a href='index.php'>Go Back</center>";
////did not make a - counter for item////
?>
Parse error: syntax error, unexpected T_ECHO in C:\wamp\www\game\buyitem.php on line 42
i followed the video exactly and im not sure what ive done...

- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#10
On line 40, you use parenthesis instead of curly braces. Since you used curly braces on your other code blocks, I am assuming this was just a typo. It should be:
Code: Select all
if ($playerinfo3['gold'] < $iteminfo3['price']);
{
echo"You do not have enough gold for this purchase!";
echo"<center><a href='index.php'>Go Back</center>";
exit;
}
The indelible lord of tl;dr
-
- Posts: 9
- Joined: Sat May 05, 2012 2:04 pm
Re: Video#10
hey jack, i used you code and that error has gone away, but now it always says i havent got enough gold for that purchase, no matter how much gold
i have? could you send me your entire buyitem.php please :S
Thanks
i have? could you send me your entire buyitem.php please :S
Thanks
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#10
I don't have a buyitem.php. Sorry! This is Halls' tutorial series not mine, and I have not gone through it, as I already knew PHP. But you should be able to download Halls' source for that script. However, it should be even better if you want to one day do customization to the source if you continue to work on this and get it working. Just review all through the script every part that references the gold and see where it is going wrong.
The indelible lord of tl;dr