Page 1 of 9
Videos 1-20
Posted: Fri Apr 02, 2010 7:20 pm
by windextor
Hey guys!
I took the liberty of uploading all of Halls' videos to MediaFire, as well as the source code.
Here are the links:
Video Tutorials Part I
Video Tutorials Part II
Part I contains videos 1-7, as well as the source code.
Part II contains videos 8-20.
The files are split this way due to size limitations (200MB per file on a free subscription: the thing is that the first batch of videos has a lot of a b c subsections, while videos 10-20 do not).
For those of you only looking for videos 11-20 (since 1-10 were already uploaded
here), there goes another link:
Videos 11-20
And finally, the source code alone:
Code
Re: Videos 1-20
Posted: Fri Apr 02, 2010 10:54 pm
by hallsofvallhalla
you rock thanks!
Re: Videos 1-20
Posted: Mon Apr 05, 2010 12:12 am
by Phill94
Yea, thanks for posting!
Guys, lemme notice you about some of Halls' tiny fails:
statpanel.php (Halls' version)
Code: Select all
////////////////////////new for video 17////////////////
echo"<br>";
$expneeded = ($playerinfo3[level] * 100) * $playerinfo3[level];
if ($playerinfo3[exper] >= $expneeded)
{ echo "<br><a href='levelup.php'>Level Up!!</a>";}
?>
</div>
As you can see, $playerinfo3[level] <- forgot the ' signs. Same with 2 others there.
Just take that part above and replace it with this code:
Code: Select all
////////////////////////new for video 17////////////////
echo"<br>";
$expneeded = ($playerinfo3['level'] * 100) * $playerinfo3['level'];
if ($playerinfo3['exper'] >= $expneeded)
{ echo "<br><a href='levelup.php'>Level Up!!</a>";}
?>
</div>
I also gets an
Notice: Undefined variable: bypass in C:\wamp\www\tutorial\index.php on line 60 error on my index page, but I can't figure out whats wrong unfortunately.

Re: Videos 1-20
Posted: Mon Apr 05, 2010 1:31 am
by hallsofvallhalla
its not that i forgot them, my environment doesn't require them. I often forget that most people's do. Thanks for pointing it out though so everyone knows what to fix.
can you post line 60 of you code so we can find the problem?
Re: Videos 1-20
Posted: Tue Apr 06, 2010 8:18 pm
by Phill94
I'll just paste the whole code..
I have set two "marks" so you can find line 60.
index.php
Code: Select all
<?php
include_once 'connect.php';
session_start();
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;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
include_once 'statpanel.php';
?>
<div id ="locations">
<?php
$playerhp = $playerinfo3['hpoints'];
if ($playerhp < 1)
{
echo "You are dead!" ;
echo "<br><a href='useitem.php>Use an Item";
exit;
}
if(isset($_GET['map']))
{
$bypass=1;
echo "<a href='index.php?mapchange=1&mapname=Crocania'>Crocania</a><br>";
echo "<a href='index.php?mapchange=1&mapname=Fordale Woods'>Fordale Woods</a><br>";
echo "<a href='index.php?mapchange=1&mapname=Mintus Mountains'>Mintus Mountains</a><br>";
}
if(isset($_GET['mapchange']))
{
$bypass=1;
$mapname = $_GET['mapname'];
$updateplayer="update players set location='$mapname' where name='$playerinfo3[name]'";
mysql_query($updateplayer) or die("Could not update player");
echo "You have traveled to " . $mapname . ".<br>";
echo "<a href='index.php'>To location</a><br>";
}
// Line 60 below
if($bypass != 1)
// Line 60 above
{
echo "<b><big><u>" . $playerinfo3['location'] . "</u></big></b><br>";
echo "<a href='store.php'>Visit Store</a><br>";
echo "<a href='weaponshop.php'>Visit Weapon Shop</a><br>";
echo "<a href='armorshop.php'>Visit Armor Shop</a><br>";
echo "<a href='inn.php'>Visit Inn</a><br>";
echo "<a href='spelltrainer.php'>Visit Spell Trainer</a><br>";
echo "<a href='battle.php'>Battle in Arena</a><br>";
echo "<a href='index.php?map=1'>Go to Map</a><br>";
}
?>
</div>
<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'></a>";
?>
</div>
Re: Videos 1-20
Posted: Tue Apr 06, 2010 8:23 pm
by hallsofvallhalla
oh just change this
Code: Select all
<div id ="locations">
<?php
$playerhp = $playerinfo3['hpoints'];
if ($playerhp < 1)
to this
Code: Select all
<div id ="locations">
<?php
$bypass= 0;
$playerhp = $playerinfo3['hpoints'];
if ($playerhp < 1)
basically you just need to define the variable before calling it. Just set it to 0.
Re: Videos 1-20
Posted: Tue May 18, 2010 8:45 pm
by Phill94
- Thanks.
I am here again with an
Notice: Undefined variable: pllocation in C:\wamp\www\TING\trublood\battle.php on line 97
Code: (Just scroll down until you see the "//////////////////// new for video 20", the line below is line 97.)
Code: Select all
<?php
include_once 'connect.php';
session_start();
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;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
include_once 'statpanel.php';
$pid = $playerinfo3['id'];
$name = $playerinfo3['name'];
$playerhp = $playerinfo3['hpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];
?>
<div id="table">
<?php
if (isset($_GET['randid']))
{
$randid=$_GET['randid'];
$iteminfo="SELECT * from inventory where randid='$randid' AND id ='$pid'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
if (!$iteminfo3['name'])
{
}
else
{
$iname = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
if ($type == "healing")
{
$newhp = $statadd + $playerhp;
if ($newhp > $playerinfo3['maxhp'])
{
$newhp = $playerinfo3['maxhp'];
}
$updateplayer="update players set hpoints='$newhp' where id='$pid'";
mysql_query($updateplayer) or die("Could not update player");
$updateitem="DELETE from inventory where id='$pid' AND randid='$randid' limit 1";
mysql_query($updateitem) or die("Could not delete item");
$playerhp = $newhp;
echo "Used " . $iname . " and recovered " . $statadd . ".<br>";
}
}}
$creature = $playerinfo3['creature'];
if ($creature != 0)
{
$creatureinfo="SELECT * from creatures where id='$creature'";
$creatureinfo2=mysql_query($creatureinfo) or die("could not get the creature you were fighting!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);
}
else
{
//////////////////// new for video 20
$areaninfo="SELECT * from locations where location='$pllocation' AND type='arena'";
$areaninfo2=mysql_query($areaninfo) or die("could not get arena");
$areaninfo3=mysql_fetch_array($areaninfo2);
$arenalevel = $areaninfo3['level'];
$creatureinfo="SELECT * from creatures where level <= '$arenalevel' order by rand() limit 1";
$creatureinfo2=mysql_query($creatureinfo) or die("could get a creature!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);
$cid = $creatureinfo3['id'];
$updateplayer="update players set creature='$cid' where name='$name'";
mysql_query($updateplayer) or die("Could not update player");
}
$creature = $creatureinfo3['name'];
$creaturehp = $creatureinfo3['hpoints'];
$creatureattack = $creatureinfo3['attack'];
$creaturedefense = $creatureinfo3['defense'];
?>
</div>
<div id="player">
<?php
/////player info
echo "<u> " . $playerinfo3['name'] . "</u><br>";
echo "Hit points = " . $playerhp . "<br>";
echo "Attack = " . $playerattack . "<br>";
echo "Defense = " . $playerdefense . "<br><br><br>";
?>
</div>
<div id="creature">
<?php
///////creature info
echo "<u> " . $creatureinfo3['name'] . "</u><br>";
echo "Hit points = " . $creaturehp . "<br>";
echo "Attack = " . $creatureattack . "<br>";
echo "Defense = " . $creaturedefense . "<br><br><br>";
echo "<a href='attack.php'>Attack</a>";
echo "<br><a href='usemagic.php'>Use Magic</a>";
echo "<br><a href='useitem.php'>Use Item</a>";
echo "<br><a href='index.php'>Exit Arena</a>";
?>
</div>
<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'>";
?>
</div>
Re: Videos 1-20
Posted: Tue May 18, 2010 10:05 pm
by Torniquet
make location='$pllocation'
location='$plocation'
Re: Videos 1-20
Posted: Wed May 19, 2010 8:46 am
by Phill94
Torniquet wrote:make location='$pllocation'
location='$plocation'
Still doesn't work.
Re: Videos 1-20
Posted: Wed May 19, 2010 12:23 pm
by hallsofvallhalla
looks like $plocation isn't defined anywhere
define it by adding the bottom line to this
Code: Select all
include_once 'statpanel.php';
$pid = $playerinfo3['id'];
$name = $playerinfo3['name'];
$playerhp = $playerinfo3['hpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];
$pllocation = $playerinfo3['location'];///add this line