Transformers and More @ The Seibertron Store














Details subject to change. See listing for latest price and availability.
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.
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.
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
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!
Naked Magnus wrote:Correct. Missions are being created for the lower levels but not the upper levels.
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);
}
}
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);
}
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);
}
Seibertron wrote:It does not read correctly to me but apparently I'm not understanding something with the logic of the game.
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?
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;
}
}
}
Naked Magnus wrote:Put that code in there and you will be good to go.
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.
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.
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.
Naked Magnus wrote:Some context questions:
Is $min_level the minimum level of the player's active bots?
Naked Magnus wrote:Does the hmf table contain the active missions?
Naked Magnus wrote:How are the two SQL clauses joined? Is it an AND or an OR?
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.
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.
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.
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);
}
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);
}
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!!!
Burn wrote:Can confirm that missions are generating for me again and I'm not banned.
Wingz wrote:
I get this message whenever I try to access a character's page.
Return to Heavy Metal War Forum
Registered users: AdsBot [Google], Bing [Bot], Cheetron, Glyph, Google [Bot], Google Adsense [Bot], Google Feedfetcher, MSN [Bot], Yahoo [Bot]