Jump to content

Combat: Fighting Player


Recommended Posts

When a player fights another player and wins shouldn't the losing side get some kind of message saying that they lost a fight to X? It is a bit odd to login and find you are in the hospital with no indication as to why, players see this as a bug.

Also, in the case of harassment shouldn't a player have the chance to accept or reject a fight?

Link to comment
Share on other sites

You can allow for players to not be attacked while offline and that will eliminate them logging in not knowing what happened :p

Alain and I "kind of" talked about the personal log when I created a module and made my own function for it to add a player id to send to but I think I forgot to let him know that it may be a good change to be able to add an id in there to send it to. You can add in there a message to be sent to the player if they lose in the comabt function

Link to comment
Share on other sites

You can allow for players to not be attacked while offline and that will eliminate them logging in not knowing what happened

Even if online they still do not know what is happening other than seeing their stats go down, not so?

Even when online I think choosing to accept or not should be an option otherwise a player can always be bullied by being attacked by a clan the moment they logged on thus not allowing them to play!

Link to comment
Share on other sites

I'm going to be a bit honest here and say the default PVP combat module is really pointless, what does it do?

If I remember correctly the module was initially built for PVC (player vs. comp) and Alain was gracious enough to provide a PVP portion to it. So what you can do is just create your own module like my mugging one and that kind of over rides the default one and disable the link to the current combat

Link to comment
Share on other sites

If players had the option to turn an attack down then people will just do it every time they believe they are going to lose. Of course limiting x per day unless at war, if clans have that option for you, is a good thing. There should be an event or message, and if you have the ability to mug a player the bully problem (mentioned in another thread?) would be solved easily through one of several bank modules available.

Link to comment
Share on other sites

What is null, null, false in reference to:


in combat menu? I am trying to figure out why one player cannot attack although he has full recovery.

That wouldn't have anything to do with it. and to answer your question:


$label will be translated through the Translate function.

$url is the URL to call once the button is clicked.

$javascript is an optional JS code to add on the onclick event.

$target allows to define a target attribute and for example open a new window.

$return can be set to true, in which case the LinkButton function returns the HTML instead of going through an echo.

The url will be secured against URL forging, which means, players will not be able to simply change values of the parameters and expect it will work.

Also does the player have a weapon? That may have something to do with it

Link to comment
Share on other sites

Thanks, I should of checked the wiki but it is so sparse that I find I get more info here.

Yes they have a weapon and it is equipped.

Well I must say that is pretty odd. Another question is, is it only happening to that particular player?

Also look into that users energy, maybe they don't have enough energy to be combating because that very last param makes the button disabled if they do not met those requirements

Edited by KyleMassacre
Link to comment
Share on other sites

I wonder why you don't go and check the function definition directly and see that the code is actually documented ;)

For the wiki documentation: being a wiki documentation feel free to contribute if you find it too sparse.

Finally for the combat bug, I never had that. I will try to reproduce the bug. For me it doesn't have anything to do with the LinkButton function, instead it must have to do with the calculation of how much energy you need to have before being able to attack:


   $userStats = UserStat::LoadStats($userId);
   $user = array();
   $user['health'] = $userStats['Health']->value + 0;
   $user['max_health'] = $userStats['Health']->maxValue + 0;
   $user['protection'] = ceil($userStats['Dexterity']->value / 3);
   $user['min_damage'] = ceil($userStats['Strength']->value / 2.0);
   $user['energy_cost'] = $userStats['Strength']->value;

   $maxDmg = $userStats['Strength']->value * 3;
   foreach ($equipment as $i)
       // if ($i->slot == "Weapon" && $i->name != NULL)
       if (isset($i->damage))
           $maxDmg += $i->damage * $userStats['Dexterity']->value / 2.0;
       if (isset($i->protection))
           $user['protection'] += $i->protection;
       if (isset($i->energy_cost))
           $user['energy_cost'] += $i->energy_cost;
   $user['max_damage'] = $maxDmg;
   $user['reload_energy'] = ceil($userStats['Dexterity']->value * 1.5);
   $user['max_energy'] = $userStats['Dexterity']->value * 4;
   $user['energy'] = 0;


And just by the look of it, if you have put all in the strength and not in the dexterity, you will never have enough energy to attack. Call it a bug, or call it an odd formula, for me it's more that your player should have balanced a bit more his/her stat.

Link to comment
Share on other sites

That is a bug because when the user explores the default actions boost their strength a lot but not their dexterity, it also should not be a reason not to attack but I will have a look at it - definitely needs some adjustments.

I also want to add this: A game is only as good as the player who can least understand it can play - this means we cannot make a game based on our logic alone as coders. We have to code based on what if the user does this or that.

Link to comment
Share on other sites

You have cheeky responses for everything. You don't get it you are SELLING - your engine / script / code or whatever you call it has to have default logic to build upon rather than constantly fix because the intention of the code IS to create a game.

I just tested it with my own account and it is true. If you have a large strength then you are not permitted to fight. This is like saying, sorry, you are too strong to swing a sword, hence I do not understand the logic in the coding for that and YES, I know I have to change it.

Just be glad that there are others debugging the bugs so things can be improved unless you rather we all just stay silent and your engine / script / code remains flat as a pancake - let me know and I will just keep it to myself so others can just spin around top in mud and then leave your engine to try another.

Link to comment
Share on other sites

Maybe you miss the point here. The combats are normally an area which are pretty much game specific, as well as the stats. My game could allow strength of 200 while yours not. Should the game engine support all kinds of games and formula? Well in theory yes, and in practice it means that you have to edit the formula to match your rules.

You may not like to edit someone else code, and that seems to me really clear. You expect also that I will fix all the things as you want them. Well at some point I shall give up. As said, we don't agree on the way the things should work nor we can. For me this is a blackboard where you build your game and logic. The combats should be re-written or at least edited to fit your needs as well as many other areas of the game. Does that mean the engine comes naked without anything? Nope, it means just that you are not free of work.

Link to comment
Share on other sites

My game could allow strength of 200 while yours not.

I don't buy that - it is just a cop out statement.

If it was really the intention then the game must state that, but like so many things with this system there is no documentation so instead of working on making the game better you have to stop and waste precious time trying to figure out why something that should work does not.

However, you are clear and like many others I have seen come and go from here I will not bring up anything else on this site unless it is critical.

Link to comment
Share on other sites

I don't want to jump in an argument here but I since I have been here since the announcement of NWE and in a way watched the progress of it even though I have really only been using the engine for roughly 3 months in a development stage, I would tend to lean towards Alains point of view. mainly because since the start he has stated that this is an engine and not a game.

He creates modules for game owners to kind of use as building blocks to create your own game to your liking and 99% of it is customizable and I feel it is the job of the game owner is to adjust stuff to fit your needs like training for example. Sure he has default columns in the table but its just used as a visual aid to show you how to create a new training session.

And DM, I for one can only speak about myself but I do appreciate you coming in and voicing your concerns and on the flip side of that you must remember also that there may be some stuff that you yourself have to add/remove that you want because the developers can not implement everything that SHOULD be a default feature cause then someone else may come in and say why is that there?

I hope this makes sense! Also its good that you come in and post about stuff because you may have the same ideas or whatever someone else does or maybe give someone else an idea of what should be there and people can implement it

Link to comment
Share on other sites

It is certainly positive when somebody have concerns about a point of another in the engine. And usually I'm pretty much open to discussion as long as the engine remains an engine and don't go too much in one or in another direction. Since the beginning of NWE, I created this project to help others create their own and UNIQUE game, not to offer something pre-cooked where you just have to put in some nice template, maybe change 1 or 2 texts and be up and running. It would be the same difference between an MP3 which you can hear directly and it's nice since you pay it and a software to compose your music. The second one is certainly more complex and may require you a lot more time to reach anything nice, yet it offers you more flexibility.

Also, I do have a different point of view between what is a bug and what is simply a feature missing. For you whatever doesn't work out of the box as players expect is a bug, while fore me it's simply an area which should be improved either by the NWE core developer (me), a 3rd party module developer or yourself the game owner. In many cases as I repeated you since nearly your first complain, what you have in mind may completely differ from other people point of view and therefore must not be put in the engine. An example? Well the last one is this jQuery issue you have, saying some people may block google for security reasons. Well, sure of course that could happen. Yet somehow I doubt a company would block google and yet not block your own game. At the same time why not be scared by the fact the engine uses Javascript? As that could be yet something else somebody want to disable, and guess what, many many areas of the game will not work anymore without Javascript.

Overall, I remain here in case of real bugs, or if you want to get some knowledge about a particular piece of code of feature, but don't doubt I will continue to answer in the same manner if you ask features / changes which are pretty much game dependent.

Link to comment
Share on other sites

As a combat system, regardless of what the end user wants, I would expect a combat system, which if they require to be changed, can be changed.

I have never encountered a combat system that requires all stats to be within line of each other, to be able to attack. That limits players to be playing one way, stat wise, if they have to keep them balanced.

It's just not logical in my opinion and the core module should have just allowed any stats amount to fight against another -- the end user should be the one to edit it to be the other way.

And before the argument comes in regards to it being an engine and not a game, my point is this -- every module on your page is game related, which makes it a game engine. When I see blog modules etc, I'll change my point of view, but for now it remains a game engine and the base module in this case does not do as it should be expected to do.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...