Jump to content

kyonides

Member
  • Content Count

    43
  • Joined

  • Last visited

  • Days Won

    2

kyonides last won the day on March 31

kyonides had the most liked content!

Community Reputation

5

About kyonides

  • Rank
    Advanced Member

Profile Information

  • Interests
    Scripting, Writing, Prophecies

RPG Maker Information

  • RM Skill -
    Coder

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. KDualWield & Accessory Skills XP + VX + ACE by Kyonides Introduction Do you want to force your heroes to equip two weapons and probably even an accessory before they can use that super cool skill you have come up with? :think: Now you can do it! XP handles it in an entirely different way, so I prefer not to post the code here. XP users will feel more comfortable by testing the demo. You will need to use 1 out of 2 Note Tags to that Skill Notes to make it happen! VX Script # * KDualWield & Accessory Skills VX * # # Scripter : Kyonides Arkanthes # 2023-02-09 # * Free as in beer * # # Force your heroes to equip specific weapons or even an accessory as well # in order to be enabled to cast a specific skill. # NOTE: The Weapons Order does NOT matter here! # * Note Tags * # # - For Dual Weapons: _dual 1 2_ # - For Weapons & Accesory: _dual 1 2 acc 1_ module KDualWield REGEX_WEAPONS = /_dual (\d+) (\d+)_/i REGEX_WEAPONS_ACCESSORY = /_dual (\d+) (\d+) acc (\d+)_/i end class Game_Battler alias :kyon_dual_wpn_skill_can_use? :skill_can_use? def skill_can_use?(skill) result = kyon_dual_wpn_skill_can_use?(skill) return result if self.class == Game_Enemy or !two_swords_style if skill.note[KDualWield::REGEX_WEAPONS] return both_weapons?($1.to_i, $2.to_i) elsif skill.note[KDualWield::REGEX_WEAPONS_ACCESSORY] return weapons_acessory?($1.to_i, $2.to_i, $3.to_i) end result end end class Game_Actor def weapon_ids [@weapon_id, @armor1_id] end def both_weapons?(w1, w2) weapon_ids.sort == [w1, w2].sort end def weapons_acessory?(w1, w2, a1) both_weapons?(w1, w2) and @armor4_id == a1 end end VX ACE Script # * KDualWield & Accessory Skills ACE * # # Scripter : Kyonides Arkanthes # 2023-02-08 # * Free as in beer * # # Force your heroes to equip specific weapons or even an accessory as well # in order to be enabled to cast a specific skill. # NOTE: The Weapons Order does NOT matter here! # * Note Tags * # # - For Dual Weapons: _dual 1 2_ # - For Weapons & Accesory: _dual 1 2 acc 1_ module KDualWield REGEX_WEAPONS = /_dual (\d+) (\d+)_/i REGEX_WEAPONS_ACCESSORY = /_dual (\d+) (\d+) acc (\d+)_/i end class Game_Battler alias :kyon_dual_wpn_skill_cond_met? :skill_conditions_met? def skill_conditions_met?(skill) result = kyon_dual_wpn_skill_cond_met?(skill) return result if self.class == Game_Enemy or !dual_wield? if skill.note[KDualWield::REGEX_WEAPONS] return both_weapons?($1.to_i, $2.to_i) elsif skill.note[KDualWield::REGEX_WEAPONS_ACCESSORY] return weapons_acessory?($1.to_i, $2.to_i, $3.to_i) end result end end class Game_Actor def equip_weapons @equips[0..1].map{|w| w.object ? w.object.id : -1 } end def both_weapons?(w1, w2) equip_weapons.sort == [w1, w2].sort end def weapons_acessory?(w1, w2, w3) both_weapons?(w1, w2) and @equips[4].object.id == w3 end end Download Now! Terms & Conditions Free as in beer. Include me in your game credits! Do not repost it anywhere!
  2. kyonides

    Help with Yanfly's Victory Aftermath

    On a new project just add that Aftermath script. Then add 1 of the other scripts and go test the game again. If everything works as intended, add another script. Keep repeating this process. Pay attention to the exact moment when it stops showing the stats. Stop adding more scripts to the new project. Come back with the results.
  3. kyonides

    KyoAlert XP-MV

    The Kitten Ordeal Minisodes Have Arrived! They explain the situation that lead me to rebrand this family of scripts. Sort of. XD
  4. kyonides

    Need help managing generator assets

    If they share a common filename that needs to be converted to a predefined one... perhaps it could be done with a script or plugin but...
  5. kyonides

    KyoAlert XP-MV

    KyoAlert XP through VX Ace Have Been Updated!
  6. It took me a couple of hours to figure out what the RM devs had changed in the source code when developing MV's default plugins by defining functions with names that were never used in the RGSS based engines. Even so, that didn't prevent me from publishing KItemAlert MV! XD

  7. kyonides

    KyoAlert XP-MV

    A New Port Has Arrived! Now MV can also enjoy the benefits of using the KyoAlert plugin!
  8. Busy reporting an insignificant Ruby "bug" that nobody would ever trigger if they do learn how to program in Ruby correctly...
    Yet, it's some real bug-like stuff, guys!

    1. Kayzee

      Kayzee

      what's the bug?

    2. kyonides

      kyonides

      Nothing an average person would ever do.

      module Some
        A = "A"
        class Thing
          include Some
          B = "B"
        end
      end

      That would allow you to concatenate the Constants as many times as you wish by adding either more Some modules or Thing classes to the long list of class/module names. You could reach the moon by doing that. XD

  9. kyonides

    Understanding RGSS

    The Other Bad Practices Found in RGSS Scripts We all should know by now how to declare an if or unless conditional statement. Happy with a sweat Yet, there are people out there that do weird stuff while doing so. In some cases the culprit was the RMXP's default code. For those guys that entered the scene after RMVX or RMVX Ace came out, I have no excuse. Confused if variable == true print "It's true!" end if variable == false print "It isn't true..." end This is one of the most extreme cases seen so far. For some reason, the guy checks the same variable twice, once for a truthy value and another for its opposite value. It is terrible! Angry Just like in many other languages, there are other ways to check the same value appropiately, without repeating oneself. if variable == true print "It's true!" elsif variable == false print "It isn't true..." end There we can see how to define a second condition using elsif instead. It certainly means "else if" there. If we were checking for totally different values, that solution would be fine. Even so, we are only checking what is its actual boolean value and under such circumstance, there is an easier way to deal with it. if variable == true print "It's true!" else print "It isn't true..." end Yes guys! That is all you needed to do from the very beginning! Laughing Shocked But wait! There is more you need to learn here about those statements! if is_variable print "It's true!" else print "It isn't true..." end Grinning It is quite interesting how the code still works, don't you think? Thinking But why does it work here? Who Knows? There is an easy explanation. In Ruby, unlike C or C++, all objects return a truthy value if they are not equal to nil of the NilClass or false for obvious reasons. In C it would be quite common to see something like the following code: if (result) { return "You were successful!"; } else { return "You failed!"; } The negative way to declare that kind of statement would be: if (!state) { return "LoadError: Failed to load script."; } A ! bang, yes, a ! bang there means negative value or opposite value or simply false. And guess what? That does exist in Ruby as well! if !is_done print "In the works!" else print "Done!" end Of course, newcomers might need to include the equality operator and the true value like this == true but in the professional world that is not used at all. The only reason why you would ever, if ever, use it would be to test if an object is equal to true or false or nil in a threefold check. And this is extremely uncommon, guys! Happy with a sweat Toggling Switches So how can we apply that knowledge to changing the boolean value of a Game Switch? Thinking Just use the following code: $game_switches[1] = !$game_switches[1] A Curious But Nonsensical Idea Some time ago somebody wrote me a message telling me how dangerous it would be to do the following while using modules and classes. module Some ONEISTHERE = "Someone is there!" class Thing include Some end end OK, I got to say that it is idiotic per se, still, this person wanted me to warn you about it. The reasoning behind it was that it would create a terrible loop that should be avoided at all costs. Interesting conclusion. Thinking [Mad Scientist Mode ON] Let us test this theory, guys! Nope, as we can see in the picture above, that is CERTAINLY NOT the case there! What has happened was that we simply created a "new link" to the Constants already declared in the module above. The only thing we have achieved was to come up with a redundant way to get to the same old Constant. XD It was totally unnecessary for sure. =_=¬° [Mad Scientist Mode OFF]
  10. KMessageTarget MV 2 Versions by Kyonides Arkanthes Introduction By default the Battle Log doesn't expect you to add a target's name to a skill action message. This plugin changes that to make sure you can certainly read who's the hero's current target. Simple Version //=========================================== // * KMessageTargetMV.js - Simple Version //=========================================== /*: * @plugindesc This plugin will let you add the enemy's name to a skill's * action message by using a tag or wildcard. * @author Kyonides Arkanthes * @help Date: 2023-01-30 * # * Free as in beer. * # * The regular expression or regex is %e by default. */ function KMessageTarget() { throw new Error('This is a static class'); } KMessageTarget.regex = /%e/i; Window_BattleLog.prototype.displaySkillTargets = function(subject, item, targets) { let target = 0; let msg = ""; for (var i = 0; i < targets.length; i++) { target = targets[i]; if (item.message1) { msg = subject.name() + item.message1.format(item.name); msg = msg.replace(KMessageTarget.regex, target.name()); this.push('addText', msg); } if (item.message2) { this.push('addText', item.message2.format(item.name)); } } } const KMessageTarget_win_btl_log_displayAction = Window_BattleLog.prototype.displayAction; Window_BattleLog.prototype.displayAction = function(subject, item, targets) { if (DataManager.isSkill(item)) { this.displaySkillTargets(subject, item, targets); } else { KMessageTarget_win_btl_log_displayAction.call(subject, item); } }; Window_BattleLog.prototype.startAction = function(subject, action, targets) { let item = action.item(); this.push('performActionStart', subject, action); this.push('waitForMovement'); this.push('performAction', subject, action); this.push('showAnimation', subject, targets.clone(), item.animationId); this.displayAction(subject, item, targets); }; Full Version //=========================================== // * KMessageTargetMV.js - Full Version //=========================================== /*: * @plugindesc This plugin will let you add the enemy's name to a skill's * action message by using a tag or wildcard. * @author Kyonides Arkanthes * @help Date: 2023-01-30 * # * Free as in beer. * # * * The regular expressions or regex are * %a for an Actor or Ally * %e for an Enemy * * Note Tag: _party item_ * It allows your hero uses an item on all of his or her allies while preventing * the Battle Log from repeating itself over and over again. * * You can customize the KMessageTarget.party_as_target string if necessary. */ function KMessageTarget() { throw new Error('This is a static class'); } KMessageTarget.item_list = [1, 6]; KMessageTarget.actor_regex = /%a/i; KMessageTarget.enemy_regex = /%e/i; KMessageTarget.no_target_item = / on %a/i; KMessageTarget.party_item = /_party item_/i; KMessageTarget.party_as_target = "the party"; Window_BattleLog.prototype.displaySkillTargets = function(s_name, item, targets) { let target = 0; let msg = ""; for (var i = 0; i < targets.length; i++) { target = targets[i]; if (item.message1) { msg = s_name + item.message1.format(item.name); msg = msg.replace(KMessageTarget.actor_regex, target.name()); msg = msg.replace(KMessageTarget.enemy_regex, target.name()); this.push('addText', msg); } if (item.message2) { this.push('addText', item.message2.format(item.name)); } } } Window_BattleLog.prototype.processNames = function(s_name, item, t_name) { let msg = TextManager.useItem.format(s_name, item.name); if (!KMessageTarget.item_list.includes(item.id)) { msg = msg.replace(KMessageTarget.no_target_item, ""); } msg = msg.replace(KMessageTarget.actor_regex, t_name); this.push('addText', msg); } Window_BattleLog.prototype.displayItemTargets = function(s_name, item, targets) { if ( KMessageTarget.party_item.exec(item.note) ) { this.processNames(s_name, item, KMessageTarget.party_as_target); return; } let target = 0; for (var i = 0; i < targets.length; i++) { target = targets[i]; this.processNames(s_name, item, target.name()); } } Window_BattleLog.prototype.displayAction = function(subject, item, targets) { let numMethods = this._methods.length; if (DataManager.isSkill(item)) { this.displaySkillTargets(subject.name(), item, targets); } else { this.displayItemTargets(subject.name(), item, targets); } if (this._methods.length === numMethods) { this.push('wait'); } }; Window_BattleLog.prototype.startAction = function(subject, action, targets) { let item = action.item(); this.push('performActionStart', subject, action); this.push('waitForMovement'); this.push('performAction', subject, action); this.push('showAnimation', subject, targets.clone(), item.animationId); this.displayAction(subject, item, targets); }; Side Note: There should be another regex that I could have used there, yet, I preferred to use a very specific one that people could quickly interpret as an enemy's name if they ever find it in the message box. We could say it's a very friendly reminder of what it actually stands for. Terms & Conditions Free as in beer. Include my nickname in your game credits. Read the instructions. Do not repost it.
  11. KTouchNewMapEvent XP + VX + ACE + MV by Kyonides Arkanthes Introduction Did you ever want that the engine would autorun events right after being touched by the player or another event? Especially once it finishes transferring the player to a new map... Now you can do that! Just copy and past the following snippet on your script editor! Download the Scripts! XP Version # * KTouchNewMapEvent XP # Scripter : Kyonides Arkanthes # 2022-09-29 # * Plug & Play Script * # # This scriptlet allows you to run an event after being transferred to another # map. It will run even if the trigger were the Player Touch or Event Touch one. # * Aliased Method: Game_Event#initialize class Game_Event alias :kyon_touch_new_map_event_init :initialize def initialize(map_id, event) kyon_touch_new_map_event_init(map_id, event) check_shared_location end def touch_trigger?() [1, 2].include?(@trigger) end def player_new_x?() $game_temp.player_new_x == @x end def player_new_y?() $game_temp.player_new_y == @y end def check_shared_location start if touch_trigger? and player_new_x? and player_new_y? end end VX Version # * KTouchNewMapEvent VX # Scripter : Kyonides Arkanthes # 2022-09-29 # * Plug & Play Script * # # This scriptlet allows you to run an event after being transferred to another # map. It will run even if the trigger were the Player Touch or Event Touch one. # * Aliased Method: Game_Event#initialize class Game_Player attr_reader :new_x, :new_y end class Game_Event alias :kyon_touch_new_map_event_init :initialize def initialize(map_id, event) kyon_touch_new_map_event_init(map_id, event) check_shared_location end def touch_trigger?() [1, 2].include?(@trigger) end def player_new_x?() $game_player.new_x == @x end def player_new_y?() $game_player.new_y == @y end def check_shared_location start if touch_trigger? and player_new_x? and player_new_y? end end VX ACE Version # * KTouchNewMapEvent ACE # Scripter : Kyonides Arkanthes # 2022-09-29 # * Plug & Play Script * # # This scriptlet allows you to run an event after being transferred to another # map. It will run even if the trigger were the Player Touch or Event Touch one. # * Aliased Method: Game_Event#setup_page class Game_Player attr_reader :new_x, :new_y end class Game_Event alias :kyon_touch_new_map_event_setup_page :setup_page def touch_trigger?() [1, 2].include?(@trigger) end def player_new_x?() $game_player.new_x == @x end def player_new_y?() $game_player.new_y == @y end def check_shared_location start if touch_trigger? and player_new_x? and player_new_y? end def setup_page(new_page) kyon_touch_new_map_event_setup_page(new_page) check_shared_location end end MV Version //================================== // * KTouchNewMapEventMV.js //================================== /*: * @plugindesc This plugin will be triggered if any given event's coordinates * match the player's and its trigger is either a Player or Event Touch. * @author Kyonides Arkanthes * @help Date: 2023-01-29 * */ const KTouchNewMap_event_setupPage = Game_Event.prototype.setupPage; Game_Player.prototype.newMapX = function() { return this._newX; } Game_Player.prototype.newMapY = function() { return this._newY; } Game_Event.prototype.setupPage = function() { KTouchNewMap_event_setupPage.call(this); this.checkEventTriggerNewMapTouch(); }; Game_Event.prototype.checkEventTriggerNewMapTouch = function() { if (this._trigger == 1 || this._trigger == 2) { if ($gamePlayer.newMapX() == this.x && $gamePlayer.newMapY() == this.y) { this.start(); } } }; Notes Honestly, there are other ways to trigger events without using scripts. Yet, you can still use my scriptlet to make it possible by setting its trigger as Player Touch or Event Touch. Terms & Conditions Free as in beer and as in speech. Please include my nickname in your game credits.
  12. KSkillNeedsState XP + VX + ACE by Kyonides Arkanthes Introduction Do you need to restrict the usage of a skill by forcing the hero to get a specific state first? Now you can do that! In XP's case Adjust the Constants you can see below as deemed necessary. module KSkillNeedsState SKILL_IDS = [57] STATE_ID = 17 end In VX & VX ACE The only thing you need to do is leaving a very specific note in the skill's note box. _need state ID_ Replace ID with a number. Download the Demos! XP Version # * KSkillNeedsState XP * # # Scripter : Kyonides Arkanthes # 2023-01-29 # * Free as in Beer * # # Adjust the values of the SKILL_ID and STATE_ID Constants at will. module KSkillNeedsState SKILL_IDS = [57] STATE_ID = 17 end class Game_Battler alias :kyon_gm_btlr_skill_can_use? :skill_can_use? def skill_need_state?(skill_id) KSkillNeedsState::SKILL_IDS.include?(skill_id) end def has_state_dependent_skill? state?(KSkillNeedsState::STATE_ID) end def skill_can_use?(skill_id) result = kyon_gm_btlr_skill_can_use?(skill_id) if result and skill_need_state?(skill_id) result = has_state_dependent_skill? end result end end VX Version # * KSkillNeedsState VX * # # Scripter : Kyonides Arkanthes # 2023-01-29 # * Free as in Beer * # # Leave this note _need state ID_ in the Skill's Note box. # There ID stands for any existing State ID. module KSkillNeedsState SKILL_REGEX = /_need state (\d+)_/i end class Game_Battler alias :kyon_gm_btlr_skill_can_use? :skill_can_use? def skill_need_state?(skill) return true if skill.note[KSkillNeedsState::SKILL_REGEX] == nil state?($1.to_i) end def skill_can_use?(skill) result = kyon_gm_btlr_skill_can_use?(skill) result = skill_need_state?(skill) if result result end end VX ACE Version # * KSkillNeedsState ACE * # # Scripter : Kyonides Arkanthes # 2023-01-29 # * Free as in Beer * # # Leave this note _need state ID_ in the Skill's Note box. # There ID stands for any existing State ID. module KSkillNeedsState SKILL_REGEX = /_need state (\d+)_/i end class Game_Battler alias :kyon_gm_btlr_skill_cond_met? :skill_conditions_met? def skill_need_state?(skill) return true if skill.note[KSkillNeedsState::SKILL_REGEX] == nil state?($1.to_i) end def skill_conditions_met?(skill) result = kyon_gm_btlr_skill_cond_met?(skill) result = skill_need_state?(skill) if result result end end Terms & Conditions Free as in beer. Include my nickname in your game credits.
  13. kyonides

    alternate battle drop treasure screen

    I don't pretend to give you hope on getting a direct answer, but I felt the need to ask you this: are you using a frontview or sideview battle system? Or some action BS? Every single one of them would require a different approach depending on the BS and their custom functions.
  14. kyonides

    Hello everyone.

    And from your experience, is Unity suited for RPG's? Or it'd be better to use it to develop other game genres?
  15. kyonides

    eventing Detect Distance Between Player and Object

    OK, here's another explanation on why he had to multiply by -1 while calculating the distance via event commands. It's because the engine developers didn't think it was necessary to add the absolute value concept in the Change Game Variable event command. The same calculation could have been done by adding distance_x.abs + distance_y.abs in Ruby and RGSS. Giving thumbs up to Vectra for coming up with this way to event it. So let's go back to 7th grade stuff here. |a - b| = |b - a| # Example 1 |5 - 2| = |3| = 3 # Example 2 |-2 - 5| = |-7| = 7 # Example 3 |3 -(-2)| = |3 + 2| = |5| = 5 In Ruby and RGSS it would be coded like this: dx = (x1 - x2).abs #=> Integer dy = (y1 - y2).abs #=> Integer d = (dx + dy).abs #=> Integer The pipes there are a symbol for the absolute value, which will end up being used as distance. In Ruby we use the abs method instead. Integer there is a placeholder for any positive number, in this case there are no decimals nor fractions involved. #=> is just a Rubyist's way to tell you what might be its return value from a human perspective without executing that part of the code. # marks the beginning of an inline comment. The equation tells us that no matter which one you subtract from the other value, the absolute value remains the same and will always be positive. So if you get as a result -7 or 7, the real distance will always be 7. You only use the negative value as a way to tell the player or game dev if the direction is negative. How does that translate to RGSS or even JS in the RM series? It's quite simple. -X means to the left hand side while -Y will always be to the upper border of the game window. If you just need either the distance on the X or Y axis, you gotta skip the third line of code then. Well, I'm leaving here some interesting read for geeks just in case they care about weird programming stuff.
×
Top ArrowTop Arrow Highlighted