Browser MMO Video #4

Location of the Videos
Socapex
Posts: 16
Joined: Sun Jun 14, 2009 10:00 pm

Re: Video #4

Post by Socapex »

ok, so in this case, we dont allow more than one email address in the database, and thus we get the guy. I think I'm getting there :)

EDIT: one email adress per person
User avatar
Bones
Posts: 58
Joined: Sat Jun 27, 2009 1:49 pm

Re: Video #4

Post by Bones »

Hmm, smooth sailing up to this point.
I'm not sure what the problem is, but I'm noticing the players health isn't updating when damage is said to be given to player.
Now I've changed hpoints to health, if you advise against this then I'll stop what I'm doing.
But I figured I was safe, I've checked all instances of the word hpoints in battle.php, attack.php
And all was fine.

Also I changed player1 to admin
Not sure if this should effect things but I make sure to check all files and I know that shouldn't be the problem.

Also I've noticed when we kill a monster it is killed from the sql?
Is that correct or did I do something wrong. O.o
Edit: Nevermind... I figured it out.
It was the fact that I had changed player1 to admin...
Onto the other tutorials!

Anyways all of this is great so far, I've learned a lot. :D
If you ever want to make a game on the side, I've got all the original graphics you'll ever need for free.
I'm also willing to contribute any ideas towards this, not sure if you've gotten there yet but I'd really like to know how make a grid map and keep track of X and Y corridinates, as well as perhaps a bank and shop (if you have gotten there already I apologize as I am not that far yet)

Cruising right along though, keep up the good work.
Last edited by Bones on Tue Jun 30, 2009 5:02 am, edited 1 time in total.
User avatar
Bones
Posts: 58
Joined: Sat Jun 27, 2009 1:49 pm

Re: Video #4

Post by Bones »

Okay so since I got it working my only question now is, are the monsters supposed to be getting deleted from the sql when they are killed?
Because that is what is happening for me, just wondering if this is supposed to happen or not.
mrmajic
Posts: 117
Joined: Sat Jun 27, 2009 9:37 am

Re: Video #4

Post by mrmajic »

yeah that is right .. but u can change it ..

The problem i was finding was having to reinvent them all the time while i was testing my scripts.. so i made a script to auto insert them back everytime it was ran:

_create_creatures.php

<?php
require_once 'connect.php';
$SQL = "INSERT into creatures(name, hpoints, attack, defence, exper) VALUES ('orc','10','3','2','5')";
mysql_query($SQL) or die("could not insert orc");
$SQL = "INSERT into creatures(name, hpoints, attack, defence, exper) VALUES ('demon','7','2','1','3')";
mysql_query($SQL) or die("could not insert demon");
$SQL = "INSERT into creatures(name, hpoints, attack, defence, exper) VALUES ('wrench','4','1','1','2')";
mysql_query($SQL) or die("could not insert wrench");
echo "The following creatures were released back into the wild: ORC, DEMON, WRENCH";
?>

everytime this script is ran, it inserts 3 creatures into the database. . beats retyping them all the time :)
Mr Majic...

Current Project: http://www.deltarealm.net
feedback welcome.
User avatar
Bones
Posts: 58
Joined: Sat Jun 27, 2009 1:49 pm

Re: Video #4

Post by Bones »

so in like battle.php put

Code: Select all

include 'create_creatures.php';
To have it create the 3 creatures it could choose?

When I tried that it said "could not insert orc"
So I guess not. :P
mrmajic
Posts: 117
Joined: Sat Jun 27, 2009 9:37 am

Re: Video #4

Post by mrmajic »

check the spelling of defence...

it was defense .. but i changed it to defence .. just change it in the script that i made.. from defence to defense....
Mr Majic...

Current Project: http://www.deltarealm.net
feedback welcome.
User avatar
Bones
Posts: 58
Joined: Sat Jun 27, 2009 1:49 pm

Re: Video #4

Post by Bones »

Still get the same error after completing what you said to fix.
How are you executing the code?

Code: Select all

<?php
include 'connect.php';
include 'create_creatures.php';
?
Thats what I have at the top of my battle.php
mrmajic
Posts: 117
Joined: Sat Jun 27, 2009 9:37 am

Re: Video #4

Post by mrmajic »

also, make sure in your creatures table defense or defence.. what ever spelling your using... its gotta be all spelt the same way to work.
Mr Majic...

Current Project: http://www.deltarealm.net
feedback welcome.
mrmajic
Posts: 117
Joined: Sat Jun 27, 2009 9:37 am

Re: Video #4

Post by mrmajic »

i just put it in my servers root dir .. c:\webs\tutorial ... and just run http://localhost/tutorial/_creature_creatures.php when ever i kill them all off..
Mr Majic...

Current Project: http://www.deltarealm.net
feedback welcome.
User avatar
Bones
Posts: 58
Joined: Sat Jun 27, 2009 1:49 pm

Re: Video #4

Post by Bones »

Okay got it all working. :D
Thanks majic.

Though atm, I'm just going to create_creatures.php manually.
Not sure how to make it execute when all creatures are dead.
Post Reply

Return to “Older Browser MMO Videos”