Daily Lucky Numbers:
4
13
18
26
35
47

Battle Mod

Started by Fog, July 10, 2013, 10:14:27 PM

Previous topic - Next topic

Fog

No I didn't add the mon_range...see link below

http://www.simplemachines.org/community/index.php?topic=323835.0

QuoteThis is what you want to do, is that correct?

Yes...

Fog

Right now...I updated all the sources and the Battle Template.

And it's working right however...it's backwards...I enter "1" in the max_range column and "80" in the mon_range column.

Chen Zhen

Use this mod install:
http://s000.tinyupload.com/index.php?file_id=48806241122561744862

.. the only edit you should have to make is changing the word monster to tank in the language file. All other edits are done including the admin template.


btw the part of code we were looking for was in Battle_Explore.php & was the function of explore_monster_init()
.. I had to bump the mysql query first to check the ranges and use logic to compare it to the user level.
The mod was set up to have a 1 in 5 chance of the monster attacking you. I edited it so that it will only do that if within the range level specified otherwise it will not attack.

Fog

I switched this code and the greater than > or less than < and now it works perfect.

// Attack or run away?
if ($row['mon_range'] <= $user_info['level'] && $row['mon_max_range'] >= $user_info['level']) {
echo '




Chen Zhen

Quote from: Fog on July 13, 2013, 03:43:44 PM
I switched this code and the greater than > or less than < and now it works perfect.

// Attack or run away?
if ($row['mon_range'] <= $user_info['level'] && $row['mon_max_range'] >= $user_info['level']) {
echo '


Fog,

  That logic is for when you decide to attack the monster or not.. you said you still wanted the option so I changed that part of the code.
See my post above for the logic we were looking for.

Fog

QuoteThat logic is for when you decide to attack the monster or not.. you said you still wanted the option so I changed that part of the code.
See my post above for the logic we were looking for.

OK I'm with you...

I just uploaded the templates and sources and it's working fine without changing those ">" or "<" around...

Totally Awesome...

I'm going to make some new tanks and give it some more testing...

Did you get your donation?

Chen Zhen

#66
Fog,

  Thank you for the donation as it is appreciated.. I have not checked paypal yet but I will.

  There were some glitches with that last mod file that I have fixed. Before I post it should I change the possibility of those that can now attack to a greater percentage? The current setting is they will attack 25% of the time but since not all enemies attack now perhaps that number should be greater?? 40% or 50% ?? What do you think?

Fog

QuoteThe current setting is they will attack 20% of the time but since not all enemies attack now perhaps that number should be greater?? 40% or 50% ?? What do you think?

That would be great but is that something I could find and change in the future if I wanted?

Chen Zhen

Fog,

  I set it to a 1 in 3 chance (33%) of the enemy attacking when within range and it works btw.

Here is that file:
http://s000.tinyupload.com/index.php?file_id=03658496250930052740

The edit for the occurrence is file: Sources/Battle/Battle_Explore.php
find:

// First Attack !!!
$this_qfirstatk = mt_rand (0, 2);

... the mt_rand function shown above picks a number 0, 1 or 2 ... if it is 1 then the enemy attacks.




  I noticed that after defeating an enemy when one clicks the link to explore it sometimes says a can't refresh error (in game error message). It is not a big deal as one can just opt the explore on the game's menu to the left but I am going to fix it anyhow. Imo this is not something I did by editing & was this already occurring before?


 

Fog

There is a couple of missing echo' in the code...I'd have to go through the old thread over on SMF to figure out where they are missing.

Chen Zhen


Here is another mod zip file:
http://s000.tinyupload.com/index.php?file_id=03193651242874192554

  I believe I fixed the issue I noted prior and some others as well.

  It looks as though someone wanted to implement a way of taking points away from some stats, adding them to the usable stat points in order to apply them to others. I gather this is why there is a minus sign when one is out of stat points. I suppose it was not completed as it is not even a link and is currently only an image. I will look into this and possibly create some links and a function to do that.

Fog

You may have hit on a glitch that we see every once in a while...

It's believed to be if you have saved any stat points and the game starts over they still show up and they don't get set back to zero.  However if you use the stat points it creates a minus stat number somewhere down the road.

Nobody can explain what they did to pin point where the glitch lays and it doesn't happen enough to know if it's really something we should be concerned about.

Under what file did you see that?

If it's under "Battle_Battle.php" then it probably was meant to attack another member and if you won you get to take away their stat points.


Chen Zhen


Fog,

  The stat points are for upgrading and the graphic minus sign is for taking them back to apply them elsewhere but that part has not been finished. I will finish it when I get the chance. The actual minus stat points are a penalty for cheating. This takes affect when one is out of stat points and attempts to use the url directly to apply them on various stats. There was an issue when it was down to 1 point which when used would penalize the user in error and set it to -1 instead of 0... I fixed that part and it should now operate properly.

Fog

I see what you're saying...If they had 1200 in stat points on DEF they could do a minus and take it down to 900 and the apply those 300 stat points towards ATK.  That would be awesome....You've done so much it's been great.

Thanks Again for all this...

Fog

Other ideas that you maybe able to add.

Progressive leveling up.

Making the Quests for only one level or putting a min max level(s) on them too.

Making the Custom Explore like the Tanks and Quests and tagging them with levels.