New account registration is temporarily disabled.

MARREND'S PROFILE

Marrend
Guardian of the Description Thread
21806
Life is a story. Which is the one that defines you?
Baclyae Revolution
A humble tribute to the Suikoden series!

Search

Filter

[RMMZ] Remove Attack (Skill 1) from an autobattler's list of actions.

So, here's what I'm suspecting is the function that occurs in MZ's auto battle algorithm with the default code.

Game_Actor.prototype.makeAutoBattleActions = function() {
    for (let i = 0; i < this.numActions(); i++) {
        const list = this.makeActionList();
        let maxValue = -Number.MAX_VALUE;
        for (const action of list) {
            const value = action.evaluate();
            if (value > maxValue) {
                maxValue = value;
                this.setAction(i, action);
            }
        }
    }
    this.setActionState("waiting");
};

What's popping out to me with this is the line that reads `const list = this.makeActionList();`. What this calls is...

Game_Actor.prototype.makeActionList = function() {
    const list = [];
    const attackAction = new Game_Action(this);
    attackAction.setAttack();
    list.push(attackAction);
    for (const skill of this.usableSkills()) {
        const skillAction = new Game_Action(this);
        skillAction.setSkill(skill.id);
        list.push(skillAction);
    }
    return list;
};

...this function. The line `attackAction.setAttack();` from that code probably calls...

Game_Action.prototype.setAttack = function() {
    this.setSkill(this.subject().attackSkillId());
};

...this method. So, my current guess is that it could be replaced with `attackAction.setSkill(skillID)`...

Game_Action.prototype.setSkill = function(skillId) {
    this._item.setObject($dataSkills[skillId]);
};

...or, somehow rework that line that it reads off of the list of possible skills that you've set up. I imagine this is done through metadata/tags?



*Edit: Or... I guess you could, theoretically, comment out the line `attackAction.setAttack();` from the `Game_Actor..makeActionList()` function entirely? Re-looking at the code, and what you want to do versus what it already does, that might be the easiest solution.

EXCEED THE MAXIMUM LIMIT OF 4 CHARACTERS ON A TEAM ? [RMMZ]

Game_Party.prototype.maxBattleMembers = function() {
    return 4;
};

This is the default code that's in MZ that limits the party size to 4. What you could theoretically do is go into rmmz_objects.js, and change it to say `return 5` instead. However, I largely recommended to not mess with the default data files. It should be a fairly simple plug-in to write...

/*:
* @target MZ
* @plugindesc Small, miscellaneous scripts
*
* @help misc.js
*
* This plugin is a collection of mini-scripts that are too small to distribute by themselves. There are no commands associated with any of them.
*
* Here's a run-down of the things this does:
*
* -Sets the battle-party size to 5, instead of 4.
*/

// Set party size.
Game_Party.prototype.maxBattleMembers = function() {
    return 5;
};

...and you can add to it later with other, similar small edits in the future. The summoning system you have in mind might not be included in such a plug-in concept.

[RMMV] complex damage formula / script

That's a fairly fixible error, as I forgot to copy that over from before.

<Custom Target Eval>
// Adds the selected target to the target list.
targets.push(target);
// Grab the group of alive foes as candidates.
var members = allies.aliveMembers();
// Remove the target from the group of candidates.
members.splice(members.indexOf(target), 1);
// This is the number of extra targets to select with Chain Lightning.
var extraTargets = 2;
// Loop the extra targets.
while (extraTargets--) {
  // Grab a random Allies from the alive foes.
  var member = members[Math.floor(Math.random() * members.length)];
  // Check to see if the member exists.
  if (member) {
    if (member instanceof Game_Party) {
      for (i=0; i<3; i++) {
        if (member === $gameParty.members()[i]) {
          // Target lies within the first four slots; cannot be targeted.
          break;
        };
      };
      // Target lies outside the first four slots; can be targeted.
      targets.push(member);
      // Remove the member as a viable candidate.
      members.splice(members.indexOf(member), 1);
    } else {
      // Add the member to the group of targets.
      targets.push(member);
      // Remove the member as a viable candidate.
      members.splice(members.indexOf(member), 1);
    }
  }
}
</Custom Target Eval>


The part I'm more leery about is the 'break' function, and if that would work as intended. Like, I'm thinking it would just break out of the if statement...

if (member === $gameParty.members()[i])


...rather than the for loop...
for (i=0; i<3; i++)


...that I want to 'break' from.

Marrend plays Heroes of Might and Magic 3 Complete!

Some wizard named Sandro approached me, asking to help him find four artifacts. I don't trust wizards, but, the reward, 500000 gold and a peice of land, wasn't something to sneeze at.

I'll keep an eye on him, but, for now, I'll search for this Skull Helmet he's asking for.


Scenario notes/asides
Starting Bonus: <40 Goblins>, 20 Wolf Riders, 15 Orcs
Win Condition: Aquire the Skull Helmet (achieved week 2, day 2)

This campaign details the rise of Crag Hack into the greater scheme of Erathia. This character is something of a repeating character, making his first appearance as a default/pregenerated character in Might and Magic - Secret of the Inner Sanctum. Back then, he was called "Crag the Hack", and was a Knight, as the Barbarian class did not exist. In all other instances of his appearance, he's just called "Crag Hack".

He had three other notable appearances in the main-line series. These are Might and Magic 3 - Isles of Terra, Might and Magic 7 - For Blood and Honor, and Might and Magic 10 - Legacy. In MM3, he was a default/pregenerated character, and was the Barbarian class there. In MM7, he was a quest-giver if you took the "evil" path. I can't quite recall what his exact role was in MM10. I want to say he was a quest-giver there?

I'm certainly leery of these campaigns that depict Sandro as a human, but, I'll get to that later.

[RMMV] complex damage formula / script

That code looks like you could be using one of Yanfly's scripts for MV? I'm not sure what gave me the idea you were using something else, but, whatever. Either way, I edited your post to include the code tag to make things more visible.

In any case, the line you're looking at...

var members = allies.aliveMembers();

...would return an array that contains the living members of a battle party. However, the variable/object `allies` could be either `$gameParty` or `$gameTroop`, depending on what the user of the skill would be. If the user is a player-controlled party member, then, `allies` would be, or refer to, `$gameParty`. If the user of the skill is an enemy the player fights, `allies` would be, or refer to, `$gameTroop`.

The code already removes the initial target, and removes targets that have already been hit by the spell. The missing ingredient, then, is to ensure that the spell can only hit an ally if they are in the first through fourth position in the party. However, to do this, you must first check if `member` is referring to `$gameParty`.

In MZ, there is a keyword of `instanceof` that can be used to check objects, and it probably exists in MV as well. However, since the two arrays could be different, you probably have to loop through `$gameParty` until the data matches.

So, I'm kinda thinking something like...

<Custom Target Eval>
// Adds the selected target to the target list.
targets.push(target);
// Grab the group of alive foes as candidates.
var members = allies.aliveMembers();
// Remove the target from the group of candidates.
members.splice(members.indexOf(target), 1);
// This is the number of extra targets to select with Chain Lightning.
while (extraTargets--) {
  // Grab a random Allies from the alive foes.
  var member = members[Math.floor(Math.random() * members.length)];
  // Check to see if the member exists.
  if (member) {
    if (member instanceof Game_Party) {
      for (i=0; i<3; i++) {
        if (member === $gameParty.members()[i]) {
          // Target lies within the first four slots; cannot be targeted.
          break;
        };
      };
      // Target lies outside the first four slots; can be targeted.
      targets.push(member);
      // Remove the member as a viable candidate.
      members.splice(members.indexOf(member), 1);
    } else {
      // Add the member to the group of targets.
      targets.push(member);
      // Remove the member as a viable candidate.
      members.splice(members.indexOf(member), 1);
    }
  }
}
</Custom Target Eval>

...this? I can't test this personally, so I apologize if this doesn't work.

Marrend plays Heroes of Might and Magic 3 Complete!

It is sometimes said that the needs of the many outweigh the needs of the few. It is with this reason that I am tasked to steal the Vial of Lifeblood from the hands of a vampire by the name of Vokail. With this artifact, the Elixir of Life can be completed.

On one hand, Vokail claims that this artifact allows him to feed with less frequency. Yet, on the other hand, the benefits of having the Elixir could far exceed the terror Vokail could raise, should the Vial be stolen. Alas, the task is before me. I can only hope the elders of the Forest Guard will not come to regret this decision.


Scenario notes/asides
Starting Bonus: 3000 Gold, 20 Rouges, <10 Sharpshooters>
Win Condition: Acquire the Vial of Lifeblood (achieved week 2, day 1)

Vokail is one of the heroes of this game, so, I thought the Vial would be with him. This would, effectively, make the win condition of this scenario to be "Defeat Vokail". This was not the case. As far as I could tell, the hero wasn't among the enemy heroes at the offset, and it's possible he was disabled from being hired as part of a custom setup.

The Vial, as it turned out, was a reward of a Seer's Hut. Said Seer's Hut exchanged it for the Titan's Gladius and the Sentinel's Shield, both of which were behind border guards of some sort.

Regardless of how this all went down, this scenario concludes the campaign. I spend 25 in-game days, earning a score of 1175 (10th place), and the title of Vampire.

[RMMV] complex damage formula / script

I might have to look into the precise code, but, off the top of my head, it could be something like...

function randomMember() {
  val = Math.randInt($gameParty.members().length - 1);
  partyID = val % 4;
  return $gameParty.members()[partyID];
};

...this, if we're talking purely about the `$gameParty` object? I'm not exactly sure how many summon-able members the player would be able to add to their party in-battle. However, I felt inclined to use the modulus function, as it returns the remainder portion of a division function. Hence, the `partyID` variable should be between 0 and 3. Which, in turn, would end up translating to the party members (surviving or not) in positions 1 through 4.

Don't ask me how to keep track of who's already been targeted with a Chain Lightning, though!

Levelling Up! Create your Birthday Character!

Oh man. I mentioned this thread here. Why not?

Level
43

Stat Distribution
Health: 24
Mana: 20
Strength: 35
Constitution: 31
Intelligence: 43
Agility: 36
Luck: 26
(Total Stat Points: 215)

Elemental Affinities
Earth: 5
Fire: 5
Wind: 5
Water: 5
Holy: 8
Dark: 4
Non-Elemental: 11

Weapon/Armor Proficiencies
Sword: 5
Spear: 7
Staff: 11

Heavy: 13
Medium: 7

Marrend reaches Level 43! -1 STR, +1 WIS!

For some reason, I felt it might be interesting to look up my stats from when we were making characters for Liberty's thread some years back. Back then, it looks like I was more warrior-like (apparently because everyone else was rolling mages), but, I feel now-a-days, I've probably respeced to mage. XD

Getting three screenshots out of a one map game

Your screenshots should indicate how the game plays, and/or what it looks like. What you're describing here sounds fine.


As an aside, the "three screenshots" rule was implemented so that people wouldn't post images that are irrelevant. Like, I don't remember where I saw this image, but, it was a screencap of a gamepage where the three images uploaded was a monster design (the graphics used was from the RTP, by the way), a title screen, and maybe one other thing that wasn't an indicator of how the game plays, and/or what it looked like.