Page 1 of 1

fight system

Posted: Fri Jul 05, 2013 10:57 am
by SyllkiT
Hello can someone put Fighting script where player can fight with other player to hallsofvallhalla mmorpg browser based game (http://www.youtube.com/watch?v=0YqFFu5d ... D8EF52C1D2)

Re: fight system

Posted: Fri Jul 05, 2013 11:07 am
by vitinho444
I haven't watched all his tutorials about it, but doesn't he cover that ?

Re: fight system

Posted: Fri Jul 05, 2013 11:17 am
by SyllkiT
vitinho444 wrote:I haven't watched all his tutorials about it, but doesn't he cover that ?
No there is a battle system with creatures !

Re: fight system

Posted: Fri Jul 05, 2013 11:52 am
by vitinho444
SyllkiT wrote:
vitinho444 wrote:I haven't watched all his tutorials about it, but doesn't he cover that ?
No there is a battle system with creatures !
Hum, I can't think of anything but you trying to upgrade it to PvP :/ I think you should worry on SP first just saying.

Sorry i can't help you :S

Re: fight system

Posted: Fri Jul 05, 2013 12:05 pm
by Callan S.
Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353

Re: fight system

Posted: Fri Jul 05, 2013 12:21 pm
by vitinho444
Callan S. wrote:Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
I think he wants a PvP system.

Re: fight system

Posted: Fri Jul 05, 2013 1:24 pm
by SyllkiT
vitinho444 wrote:
Callan S. wrote:Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
I think he wants a PvP system.
Yes i want a PvP system ( i am noob in english )

Re: fight system

Posted: Fri Jul 05, 2013 8:51 pm
by Jackolantern
SyllkiT wrote:
vitinho444 wrote:
Callan S. wrote:Not sure what's being asked for, but I set this up awhile ago to complete the monster combat, if you've watched the tutorial videos from 1 to 5.

http://indie-resource.com/forums/viewto ... =26&t=1353
I think he wants a PvP system.
Yes i want a PvP system ( i am noob in english )
PvP is difficult to pull off with PHP alone, since PHP is server-side, meaning everything has to be known at the time the request comes in to the server so it can create the HTML to send to the user. The problem with PvP in PHP is that if you try to attack another player, there is no way to notify them that they were attacked. PHP offers no way to reach back out to users once the page has loaded.

The two options are to integrate a PvP system in Javascript, which is outside the scope of the original MMO browser tutorials, or, the more common PHP PvP solution, is to create kind of a "PvP by mail" system where players trade hits over time. In a system like that, a player logs in, and checks their PvP battles. They trade a hit back to all the people who hit them while they were logged out. That is probably not the kind of PvP you want, though, which would mean Javascript would be required. I think Halls' next browser MMO tutorial series (coming sometime soon) is going to have more Javascript.

Re: fight system

Posted: Sat Jul 06, 2013 3:58 am
by Callan S.
vitinho444 wrote:I think he wants a PvP system.
Oops, I missread! :oops:

On PVP, I think using the refresh command you could have timed turns, which would ensure the page both refreshes and the other player must act within X amount of time.

Re: fight system

Posted: Sat Jul 06, 2013 4:41 am
by Jackolantern
Callan S. wrote:
vitinho444 wrote:I think he wants a PvP system.
Oops, I missread! :oops:

On PVP, I think using the refresh command you could have timed turns, which would ensure the page both refreshes and the other player must act within X amount of time.
That would still require a little bit of Javascript to timer the refresh, right? Nothing that you couldn't find on Google...or, right below this sentence:

Code: Select all

<script>
setInterval(function() {
      document.location.reload(true);     //reloads the page...
}, 4000);   //...every 4 seconds
</script>
But that poses a problem. How do you notify someone that they are being attacked? Putting this script on every page all the time would be impractical since it would cripple other game functions to constantly have the page refreshing. The simplest solution would be to use a little AJAX polling to check the db every so often to see if an attack has been made on the player.