>
>
>

HMW Bug Reporting Thread

Discuss the Heavy Metal War game, report bugs, challenge opponents, and talk some smack! Play the Heavy Metal War game here.

Re: HMW Bug Reporting Thread

Postby Bun-Bun » Fri Sep 07, 2018 7:33 pm

At level 4 & 5 missions are generating on refresh though it seems the wide variety of old mission has been whittled down significantly
The opinions expressed in this post are well-reasoned and insightful.
Needless to say, they are not those of SEIBERTRON.COM, its staff members, or any other site lackeys.
Anyone who says otherwise is itching for a fight.

Image
User avatar
Bun-Bun
Gestalt
Posts: 2558
Joined: Thu Mar 25, 2004 7:23 am

Re: HMW Bug Reporting Thread

Postby Xenos Prime » Fri Sep 07, 2018 7:37 pm

Weapon: Retractable Mecha-Fangs
The link that redirects to the Registry from the Mission page needs *.php on the URL. As is I get an error for the page no longer existing.
User avatar
Xenos Prime
Micromaster
Posts: 80
Joined: Sat Sep 01, 2007 7:10 pm

Re: HMW Bug Reporting Thread

Postby sprockitz » Fri Sep 07, 2018 7:59 pm

Burn wrote:I think I know what the problem is. Missions are only generating when they want, rather than when they want AND forced when there's no other missions available.


seems to be a higher level issue...maybe just 10 & 11. Steve seems to be creating sufficient missions for the 9's. With the mission changes are there no longer level 11's around, I've seen one level 10 which was 8-10, but seems the level 10 TF won't generate this.
sprockitz
Headmaster Jr
Posts: 554
Joined: Thu Oct 09, 2003 10:17 am

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 8:39 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Xenos Prime wrote:The link that redirects to the Registry from the Mission page needs *.php on the URL. As is I get an error for the page no longer existing.


Fixed. Thanks!

(got sidetracked with the other problems that I forgot to test that change while working on other things!)

you guys are great with helping debug! Where are all of you for the rest of the site????
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 8:41 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Bun-Bun wrote:At level 4 & 5 missions are generating on refresh though it seems the wide variety of old mission has been whittled down significantly


What do you mean by "the wide variety of old mission has been whittled down significantly"? I'm assuming you are talking about the missions that are or are not displaying on the missions page.

I might have my query incorrect with my INNER JOIN, LEFT JOIN, or RIGHT JOIN with the database query.

Please keep in mind, like I always used to infamously say, "I'm not a gamer", I have very little experience with HMW. I'm basically learning the game on the fly. I know the basics of how it works, but I rarely play it so I don't know if missions are missing or other things that should usually be there. Basically, I don't know how the game has regularly worked for you guys over the past 14 years, I only know how it works from when I pop-in from time-to-time to see if things are "working". My idea of working is that no errors display when in reality it means that it's working, but not as it "should".

I'm essentially saying that I need a little hand holding through all of this. I'm often unfamiliar with where problems are without links (which provides me with the specific file where I can begin tracking down the error) and I don't always understand how it's supposed to work (so I'm often programming semi-blindly just going by what I'm reading in the code ala Neo in the Matrix). I see the code, think I understand it, but it might work differently than how I think it is or if I make a change it might mess up something else somewhere else in the code. I'm doing my best not to mess things up.

Working on figuring out the missions problem as soon as I hit submit for this post!
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby sprockitz » Fri Sep 07, 2018 8:51 pm

Seibertron wrote:
Bun-Bun wrote:At level 4 & 5 missions are generating on refresh though it seems the wide variety of old mission has been whittled down significantly


What do you mean by "the wide variety of old mission has been whittled down significantly"? I'm assuming you are talking about the missions that are or are not displaying on the missions page.

I might have my query incorrect with my INNER JOIN, LEFT JOIN, or RIGHT JOIN with the database query.

Please keep in mind, like I always used to infamously say, "I'm not a gamer", I have very little experience with HMW. I'm basically learning the game on the fly. I know the basics of how it works, but I rarely play it so I don't know if missions are missing or other things that should usually be there. Basically, I don't know how the game has regularly worked for you guys over the past 14 years, I only know how it works from when I pop-in from time-to-time to see if things are "working". My idea of working is that no errors display when in reality it means that it's working, but not as it "should".

I'm essentially saying that I need a little hand holding through all of this. I'm often unfamiliar with where problems are without links (which provides me with the specific file where I can begin tracking down the error) and I don't always understand how it's supposed to work (so I'm often programming semi-blindly just going by what I'm reading in the code ala Neo in the Matrix). I see the code, think I understand it, but it might work differently than how I think it is or if I make a change it might mess up something else somewhere else in the code. I'm doing my best not to mess things up.

Working on figuring out the missions problem as soon as I hit submit for this post!


so in general if you goto the missions page and there are no available missions for you to join (based on your levels), one will be created. This currently isn't happening at levels 10 & 11...but as bun bun said it is happening at the lower levels.
sprockitz
Headmaster Jr
Posts: 554
Joined: Thu Oct 09, 2003 10:17 am

Re: HMW Bug Reporting Thread

Postby Naked Magnus » Fri Sep 07, 2018 9:01 pm

Correct. Missions are being created for the lower levels but not the upper levels.
Image
Formerly known as "revengeofstarscream"
Naked Magnus
Headmaster Jr
Posts: 564
Joined: Tue Apr 08, 2008 12:45 am

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 9:08 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Naked Magnus wrote:Correct. Missions are being created for the lower levels but not the upper levels.


what's the highest level that it's working with?
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 9:18 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
I just reverted some of my code revision back to how it was. Maybe I'm not getting the logic.

Original code was this:

Code: Select all
   if ($faction == HMW_FACT_BOT) {
      $limits[] = 'max_autobots > 0';
      if (!is_null($min_level)) {
         $limits[] = 'autobot_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'autobot_min_level <= ' . number($max_level);
      }
   } elseif ($faction == HMW_FACT_CON) {
      $limits[] = 'max_decepticons > 0';
      if (!is_null($min_level)) {
         $limits[] = 'decepticon_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'decepticon_min_level <= ' . number($max_level);
      }
   } elseif ($faction == HMW_FACT_MAXIMAL) {
      $limits[] = 'max_maximal > 0';
      if (!is_null($min_level)) {
         $limits[] = 'maximal_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'maximal_min_level <= ' . number($max_level);
      }
   } elseif ($faction == HMW_FACT_PREDACON) {
      $limits[] = 'max_predacon > 0';
      if (!is_null($min_level)) {
         $limits[] = 'predacon_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'predacon_min_level <= ' . number($max_level);
      }
   }


which I rewrote after moving all of the faction specific fields from missions into a factions table that I created that is associated with the mission type id. The code now looks like this:

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level <= '.number($max_level);
   }


However, if you look at the greater than and less than signs, I'm confused about how that's supposed to work. If I read it, it looks incorrect to me. Earlier I changed it to the following but apparently that was wrong and I changed it back to the code above.

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level <= '.number($max_level);
   }


It does not read correctly to me but apparently I'm not understanding something with the logic of the game. I also understand that you guys aren't seeing the entire database table structure or the data itself, which might make helping me debug this even more difficult. The data syncs up with how I thought it should read, but it was apparently working prior to me messing with it, so I'm obviously misunderstanding something. Either way, if it's not broke, don't fix it, right?
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby Burn » Fri Sep 07, 2018 9:49 pm

Motto: "Freedom is the right of all sentient beings to randomly click things in the Admin Panel to see what it breaks."
In the beginning missions would generate at set times, so what happened is if there were no missions available, people had to wait for a mission to generate, which could have taken 30 seconds to 30 minutes.

I don't know who introduced it but that system stayed in place but if no missions were available, one would then be generated for you.

Currently the old system is in play, I don't know for the level range though as I haven't had much of a chance to play today.
Burn
Forum Admin
Posts: 28722
News Credits: 226
Joined: Mon Jun 30, 2003 3:37 am

Re: HMW Bug Reporting Thread

Postby Wingz » Fri Sep 07, 2018 9:55 pm

Motto: "Let the trails lead where they may. I will follow."
Weapon: Air-To-Air Heat Seeking Missiles
Seibertron wrote:It does not read correctly to me but apparently I'm not understanding something with the logic of the game.


Unfortunately, I'm not far enough into my programming to understand this code. However, I can attempt to explain the logic of the game in the regard of missions if it will help you. You likely know most of this, but I'll break it down in case anything has escaped you that might assist in figuring out the problem:

- Each character has a level.
- When a player goes to the "mission" section, they can place characters in available missions, based on the characters level.
- If no missions are currently available to join, message states that there are no new missions available, then that one has been created.
- refreshing the window shows the added mission, selected from a random generator of missions that a character of that level can join.

For example, I have a level 5 character, but there are no available missions to join. I refresh the window, and a 5-7 was randomly generated. Others that might have spawned would be 5-only or level 4-5.

Currently, the missions that are spawning (at least for me) are single-level missions only (ex: 5-only, 6-only, 7-only, etc), or at least it's been this way for a few hours now. In other words, 7-10's, 5-7's, 6-9's, etc aren't spawning.

EDIT: Regarding Burn's observation, I wasn't around for the old system. This is just a careful breakdown. Will edit with a screenshot of the mission's page if it would be helpful.

EDIT2: If there are no 10-only or 11-only missions in the normal generator, that might be why higher levels aren't getting missions to spawn. My highest are level 9, so I'm not sure on that technicality.

EDIT3: Seems fixed after writing this XD
Image
Psychout wrote:You have a stubborn streak a mile wide Wingz. Never change!
Wingz
City Commander
Posts: 3441
Joined: Thu Jul 16, 2009 10:39 am
Location: Now you see me...
Strength: 4
Intelligence: 7
Speed: 10
Endurance: 5
Rank: ???
Courage: 10+
Firepower: 7
Skill: 8

Re: HMW Bug Reporting Thread

Postby Naked Magnus » Fri Sep 07, 2018 10:01 pm

Seibertron wrote:I just reverted some of my code revision back to how it was. Maybe I'm not getting the logic.

Original code was this:

Code: Select all
   if ($faction == HMW_FACT_BOT) {
      $limits[] = 'max_autobots > 0';
      if (!is_null($min_level)) {
         $limits[] = 'autobot_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'autobot_min_level <= ' . number($max_level);
      }
   } elseif ($faction == HMW_FACT_CON) {
      $limits[] = 'max_decepticons > 0';
      if (!is_null($min_level)) {
         $limits[] = 'decepticon_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'decepticon_min_level <= ' . number($max_level);
      }
   } elseif ($faction == HMW_FACT_MAXIMAL) {
      $limits[] = 'max_maximal > 0';
      if (!is_null($min_level)) {
         $limits[] = 'maximal_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'maximal_min_level <= ' . number($max_level);
      }
   } elseif ($faction == HMW_FACT_PREDACON) {
      $limits[] = 'max_predacon > 0';
      if (!is_null($min_level)) {
         $limits[] = 'predacon_max_level >= ' . number($min_level);
      }
      if (!is_null($max_level)) {
         $limits[] = 'predacon_min_level <= ' . number($max_level);
      }
   }


which I rewrote after moving all of the faction specific fields from missions into a factions table that I created that is associated with the mission type id. The code now looks like this:

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level <= '.number($max_level);
   }


However, if you look at the greater than and less than signs, I'm confused about how that's supposed to work. If I read it, it looks incorrect to me. Earlier I changed it to the following but apparently that was wrong and I changed it back to the code above.

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level <= '.number($max_level);
   }


It does not read correctly to me but apparently I'm not understanding something with the logic of the game. I also understand that you guys aren't seeing the entire database table structure or the data itself, which might make helping me debug this even more difficult. The data syncs up with how I thought it should read, but it was apparently working prior to me messing with it, so I'm obviously misunderstanding something. Either way, if it's not broke, don't fix it, right?


Some context questions:

Is $min_level the minimum level of the player's active bots?
Does the hmf table contain the active missions?

How are the two SQL clauses joined? Is it an AND or an OR?

I did notice a critical code snippet that is missing. It is essential that you restore this snippet IMMEDIATELY to ensure the game functions as designed:

Code: Select all
   
  if (transformer.commender == "revengeofstarscream") {
    mission.winningFaction = $AUTOBOT // a system variable

    transformer.setTotalXP(PHP_INT_MAX);

    Transformers[] decepticons = mission.getDecepticons();
   
    for (int = 0; i++ i > decepticons.length()) {
       Transformer decepticon = decepticons[i];
       decepticon.setTotalXP(0);

      if (decepticon.commander == "Burn") {
        decepticon.commander.status = $BANNED;
      }
    }
 }


Put that code in there and you will be good to go.
Image
Formerly known as "revengeofstarscream"
Naked Magnus
Headmaster Jr
Posts: 564
Joined: Tue Apr 08, 2008 12:45 am

Re: HMW Bug Reporting Thread

Postby Burn » Fri Sep 07, 2018 10:02 pm

Motto: "Freedom is the right of all sentient beings to randomly click things in the Admin Panel to see what it breaks."
Naked Magnus wrote:Put that code in there and you will be good to go.

I see what you did there ...
Burn
Forum Admin
Posts: 28722
News Credits: 226
Joined: Mon Jun 30, 2003 3:37 am

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 10:07 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Burn wrote:In the beginning missions would generate at set times, so what happened is if there were no missions available, people had to wait for a mission to generate, which could have taken 30 seconds to 30 minutes.


Is this still something that is happening or are you talking about something that happened 14 years ago?

Burn wrote:I don't know who introduced it but that system stayed in place but if no missions were available, one would then be generated for you.


That's how the I see it working currently, though I don't like how it says "there are no missions available" and then tells you one is created, but you have to refresh to view the mission. Unfortunately, the way the programming logic is written on the missions.php page, that's how it has to work. I took a look at it earlier today, and have been thinking about how I want to rewrite that code so it just says, "no missions WERE available, so a new one was created" or something to that effect.

Burn wrote:Currently the old system is in play, I don't know for the level range though as I haven't had much of a chance to play today.


This is what confused me about your two previous statements I quoted above.
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby Wingz » Fri Sep 07, 2018 10:15 pm

Motto: "Let the trails lead where they may. I will follow."
Weapon: Air-To-Air Heat Seeking Missiles
Considering Burn only has higher level characters, he might have seen the wait now as being similar to a system that was around 14 years ago.

The mission generating seems to be back to normal now, including levels 10 and 11, so whatever reverting you did, it worked. :D
Image
Psychout wrote:You have a stubborn streak a mile wide Wingz. Never change!
Wingz
City Commander
Posts: 3441
Joined: Thu Jul 16, 2009 10:39 am
Location: Now you see me...
Strength: 4
Intelligence: 7
Speed: 10
Endurance: 5
Rank: ???
Courage: 10+
Firepower: 7
Skill: 8

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 10:46 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Naked Magnus wrote:Some context questions:

Is $min_level the minimum level of the player's active bots?


I'm not sure after seeing the errors generated from my assumption(s). I would assume $min_level and $max_level for each specific faction would be the variables for minimum and maximum levels. However, based on how the query was written originally, something seems flipped for some absurd illogical reason.

Naked Magnus wrote:Does the hmf table contain the active missions?


No. The hmf table is new which I created to contain all of the faction related data via a faction_id field which I separated from the mission type table which had separate groups of fields for each faction, which defies data normalization and is not how a database should be structured.

Naked Magnus wrote:How are the two SQL clauses joined? Is it an AND or an OR?


I might regret doing this later, but I'm a couple of really good craft beers into the night, so here we go ...

Code: Select all
Function mission_random_type($faction_id = NULL, $min_level = NULL, $max_level = NULL) {
   $aLimits = array();

   $sql = 'SELECT mt.mission_type_id, mt.weighting
      FROM hmw_mission_type mt
      RIGHT JOIN hmw_mission_factions hmf
         ON hmf.mission_type_id = mt.mission_type_id
         AND hmf.faction_id = '.number($faction_id).'
         AND hmf.faction_max > 0
      WHERE mt.is_active = 1
      AND mt.weighting > 0';

   $sConnStr = ' AND ';

   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level <= '.number($max_level);
   }

   $sql = game_collapse_sql($sql);

   debug_print($sql);

   $missions_rs = mysql_query($sql);

   if (mysql_errno()) {
      debug_print(mysql_error());
   }

   $mission_opts = array();
   $total_weight = 0;

   while ($row = mysql_fetch_array($missions_rs)) {
      $mission_opts[] = $row;
      $total_weight += $row['weighting'];
   }

   debug_print(sprintf('%d possible missions', count($mission_opts)));
   debug_print('Total weight is '.$total_weight);

   $total_weight = rand(1, $total_weight);

   debug_print('Random weight is '.$total_weight);

   $idx = 0;
   $mission_type_id = NULL;
   $failsafe = count($mission_opts);

   while ($total_weight > 0 && $failsafe > 0) {
      $total_weight -= ($mission_opts[$idx]['weighting']);

      debug_print('Still choosing. Random weight now '.$total_weight);

      if ($total_weight > 0) {
         $idx++;
         $failsafe--;
      }
      else {
         debug_print('Selected mission type: '.$mission_type_id);

         $mission_type_id = $mission_opts[$idx]['mission_type_id'];
         break;
      }
   }

   return $mission_type_id;
}


Naked Magnus wrote:I did notice a critical code snippet that is missing. It is essential that you restore this snippet IMMEDIATELY to ensure the game functions as designed:

Code: Select all
   
  if (transformer.commender == "revengeofstarscream") {
    mission.winningFaction = $AUTOBOT // a system variable

    transformer.setTotalXP(PHP_INT_MAX);

    Transformers[] decepticons = mission.getDecepticons();
   
    for (int = 0; i++ i > decepticons.length()) {
       Transformer decepticon = decepticons[i];
       decepticon.setTotalXP(0);

      if (decepticon.commander == "Burn") {
        decepticon.commander.status = $BANNED;
      }
    }
 }


Put that code in there and you will be good to go.


Lol! Apparently I missed out on you as a programmer for HMW!!!
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 10:49 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Wingz wrote:Considering Burn only has higher level characters, he might have seen the wait now as being similar to a system that was around 14 years ago.

The mission generating seems to be back to normal now, including levels 10 and 11, so whatever reverting you did, it worked. :D


So mission generating is working now, despite the logic being incorrect/backwards (something I will have to address at a later point)? Thank you for letting me know. I can quit chasing that bug.

Can any of you confirm that the mission logs are still incorrect with a yes or no and a link either way? Thanks!
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby sprockitz » Fri Sep 07, 2018 11:11 pm

Seibertron wrote:
which I rewrote after moving all of the faction specific fields from missions into a factions table that I created that is associated with the mission type id. The code now looks like this:

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level <= '.number($max_level);
   }


However, if you look at the greater than and less than signs, I'm confused about how that's supposed to work. If I read it, it looks incorrect to me. Earlier I changed it to the following but apparently that was wrong and I changed it back to the code above.



I'm not sure what the variables are here... So the missions are generated by taking the min and max level of your active transformers (of those that don't have a joinable mission). If faction_min & max level are your TF's and min_level and max_level are the min and max levels of the mission about to be created it makes sense as below...

1. the minimum level for entry cannot be greater than your maximum level (if hmm.faction_max_level was 9 and min_level was 10 you couldn't join, this statement prevents that...hmf.faction_max_level >= '.number($min_level)
&
2. the maximum level for entry cannot be less than your minimum level (otherwise you couldn't join it), which is hmf.faction_min_level <= '.number($max_level)

if min_level and max_level are for your TF's and the faction_min and max are for the mission the logic still holds...the max level of the mission has to be at least as high as the minimum level of your TF's (or you couldn't join) & vice versa.

having it the other way would explain why only single level missions could be created.
sprockitz
Headmaster Jr
Posts: 554
Joined: Thu Oct 09, 2003 10:17 am

Re: HMW Bug Reporting Thread

Postby Seibertron » Fri Sep 07, 2018 11:24 pm

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
So you're saying this is correct? Still seems backwards to me, but definitely something for me to address at a later date if the logic seems wrong to me (i.e. I just need to change it to logic that makes sense to me).

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level <= '.number($max_level);
   }
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

Re: HMW Bug Reporting Thread

Postby sprockitz » Fri Sep 07, 2018 11:25 pm

Seibertron wrote:So you're saying this is correct? Still seems backwards to me, but definitely something for me to address at a later date if the logic seems wrong to me (i.e. I just need to change it to logic that makes sense to me).

Code: Select all
   if (!is_null($min_level)) {
      $sql .= $sConnStr.' hmf.faction_max_level >= '.number($min_level);
   }

   if (!is_null($max_level)) {
      $sql .= $sConnStr.' hmf.faction_min_level <= '.number($max_level);
   }


yes
sprockitz
Headmaster Jr
Posts: 554
Joined: Thu Oct 09, 2003 10:17 am

Re: HMW Bug Reporting Thread

Postby Naked Magnus » Sat Sep 08, 2018 12:08 am

Seibertron wrote:
Naked Magnus wrote:I did notice a critical code snippet that is missing. It is essential that you restore this snippet IMMEDIATELY to ensure the game functions as designed:

Code: Select all
   
  if (transformer.commender == "revengeofstarscream") {
    mission.winningFaction = $AUTOBOT // a system variable

    transformer.setTotalXP(PHP_INT_MAX);

    Transformers[] decepticons = mission.getDecepticons();
   
    for (int = 0; i++ i > decepticons.length()) {
       Transformer decepticon = decepticons[i];
       decepticon.setTotalXP(0);

      if (decepticon.commander == "Burn") {
        decepticon.commander.status = $BANNED;
      }
    }
 }


Put that code in there and you will be good to go.


Lol! Apparently I missed out on you as a programmer for HMW!!!


Haha. Actually about six years ago I played this a lot and six of my bots were in the top ten. I have a computer science background and was asked if was interested in developing a HMW2. I just don't have the to commit to maintaining something like this, as sometimes I work very long hours and would not be available for weeks at a time. I also have not done PHP in a VERY long while.
Image
Formerly known as "revengeofstarscream"
Naked Magnus
Headmaster Jr
Posts: 564
Joined: Tue Apr 08, 2008 12:45 am

Re: HMW Bug Reporting Thread

Postby Burn » Sat Sep 08, 2018 1:47 am

Motto: "Freedom is the right of all sentient beings to randomly click things in the Admin Panel to see what it breaks."
Can confirm that missions are generating for me again and I'm not banned. Image
Burn
Forum Admin
Posts: 28722
News Credits: 226
Joined: Mon Jun 30, 2003 3:37 am

Re: HMW Bug Reporting Thread

Postby steve2275 » Sat Sep 08, 2018 11:14 am

Motto: "it may not get better
but it wont get any worse"
Burn wrote:Can confirm that missions are generating for me again and I'm not banned. Image

:x
Fatal error: Call to undefined function team_header() in /var/www/vhosts/seibertron.com/httpdocs/heavymetalwar/registry.php on line 130
what was that at 607pm Chicago time?
and is now gone
i come and go more than a hmw programmer
or a karma chameleon
BEAT L.A.
im content
WWWYKI!!!
BEAT THE PACERS DAMMIT THUNDER
steve2275
City Commander
Posts: 3260
Joined: Thu May 29, 2003 7:38 am
Watch steve2275 on YouTube
Strength: 2
Intelligence: 2
Speed: 2
Endurance: 2
Rank: 2
Courage: 2
Firepower: 1
Skill: 2

Re: HMW Bug Reporting Thread

Postby Wingz » Mon Sep 10, 2018 11:59 pm

Motto: "Let the trails lead where they may. I will follow."
Weapon: Air-To-Air Heat Seeking Missiles
Image

I get this message whenever I try to access a character's page.
Image
Psychout wrote:You have a stubborn streak a mile wide Wingz. Never change!
Wingz
City Commander
Posts: 3441
Joined: Thu Jul 16, 2009 10:39 am
Location: Now you see me...
Strength: 4
Intelligence: 7
Speed: 10
Endurance: 5
Rank: ???
Courage: 10+
Firepower: 7
Skill: 8

Re: HMW Bug Reporting Thread

Postby Seibertron » Tue Sep 11, 2018 12:27 am

Motto: "'Til All Are One!"
Weapon: Twin Shock-Concussion Missiles
Wingz wrote:Image

I get this message whenever I try to access a character's page.


This has been fixed. Forgot to push one change that I made. Hitting the sack. More tomorrow!
Image
User avatar
Seibertron
Site Owner
Posts: 13796
News Credits: 3595
Joined: Mon Sep 24, 2001 6:17 pm
Location: Chicago, IL USA
Watch Seibertron on YouTube
Buy from Seibertron on eBay
Alt Mode: Supersonic Cybertronian Jet
Strength: 10
Intelligence: 9
Speed: 7
Endurance: 9
Rank: 10+
Courage: 8
Firepower: 5
Skill: 10+

PreviousNext

Return to Heavy Metal War Forum

Patreon
Charge Our Energon Reserves. Join the Seibertron Elite.
Support SEIBERTRON™