Jump to content

kyonides

Member
  • Content Count

    54
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by kyonides

  1. Klass Change & Skills XP + VX + ACE by Kyonides Introduction Perhaps you have NEVER EVER noticed that there is a missing feature (bug?) in all of the RPG Maker editions regarding the class change and its corresponding skills. Pick either XP or VX ACE or even MV and you will get the same result, your hero could change his or her class indeed... at a cost of not learning anything already listed in his or her new skillset!😮 NOTHING! Here comes my scriptlet to let you solve this issue in a couple of creative ways! Do Nothing! - Default (Still Able to Learn Skills in the Future) Replace Old Skills with New Skills. Add New Skills while Keeping the Old Skills. Keep Some of the Old Skills while Learning the New Skills. Skill Learning Modes: nil :replace :add Number, actually an Integer Actor's Notes for VX ACE Code: _class skills mode: replace_ _class skills mode: add_ _class skills mode: 5_ DOWNLOAD DEMO Terms & Conditions Free for use in any kind of game Include my nickname in your game credits! If you can adopt any creature, just don't do it! That's it!
  2. If there's a guy that sells his soundtrack PACK for something around $10.00 and there's another one that only offers you like a couple of them, guess who will get preferred over the other by the patrons?
  3. KBlockStates XP + ACE by Kyonides Introduction This script prevents your heroes or your enemies from choosing a target that is still afflicted by a Blocked Target alias Untargetable State. Set the value of the TARGET_STATE Constant found in the KBlockStates module to your Untargetable State ID. Available States: Traditional Block Target or Untargetable State No Attack State - Simple Attacks Get Blocked! No Healing State - Healing Skills Get Blocked! Don't forget to ask Sylvia about the "Bad States" whenever you see her! Other Notes This scriptlet seems to work with the default battle system so feel free to try it in your game project. I have not tested it while using any other battle system. The only reason why I came up with this idea was because Hime's script had a weird bug that has remained untouched ever since 2015... DOWNLOAD DEMO Terms & Conditions Free for use in your game. Include my nickname in your game credits. That's it.
  4. I am not offering my services but just telling you that you might need to make a better offer than the current one to entice advanced scripters to join your project. (Unless that's not really what you want to do here.) And please don't rush to conclusions just because you don't know how to do something as you were told. Asking questions is not bad, feel free to inquire of anything for any good reason. Nonetheless, declaring that something is useless because it's not what you expected or you simply are a newcomer that doesn't know how to use it, is sort of offensive. This is especially true when a veteran scripter is trying to help you somehow. Just don't do it again.
  5. Guys, my solution consists of not using a game variable at all, allowing you to save your game variables for other more important uses than just some very specific enemy's speed. For instance, you could use that variable for storing your party's gold or steps or anything else. To implement it, you'd simply copy the original script posted on the first post and then change the parts that share the same module or class name and method name. The script call would be TH.Enemy_Reposition.move_speed = +number. I don't think number 0 would ever help you there. I would also like to inform people that since this seems to be used in battle, the move speed has no real limit. Well, it never had a true limit on the map anyway. It just happens that the GUI doesn't allow you to go above 6, still, you can do that via a script call or a combo of a new script and changing the value of a game variable. Depending on your goals going over 6 might be too fast for your taste or your players' so be careful about setting a high value to it. Of course, if it is supposed to move like a ghost or a speedster by design, it might look "natural" so to say. And as a friendly reminder, don't rush to radical conclusions like some other forumer did here that can make a scripter feel like he or she is wasting his or her time by trying to offer some assistance to the OP because the poster simply refuses to accept any piece of advice for not getting the type of answer the poster had expected.
  6. Go to the method I mentioned and replace its contents with your favorite game variable ONLY, just like you did it on your first post. And don't expect me to answer any more questions. If you can follow the instructions without questioning, fine. I'll ignore future inquiries on this topic, anyway.
  7. That's the problem of dealing with a newcomer that thinks he already knows how the code works... First of all, I wanna tell you I'm not forced to tell you anything, yet, I'll do it only because my teacher's side has emerged. Even so I'll make sure I won't repeat myself. Thus you better pay close attention to this issue. NO GLOBAL VARIABLES exist at the moment the game is loading. This means that it will fail all checks at the moment it reads the global variable's contents expecting to get an array that has NEVER been created at that point. Never forget that! Never! I said NEVER! Fail to remember that and it will keep throwing weird error messages at your face. WARNING: If you're thinking that it doesn't matter and you'll directly create the variable by setting it to an Array for any reason, it will still fail because it'll be reset when the game starts a new game session. Since you only care about using your favorite game variable, you have 2 options. Using the updated version of my proposed changes, stop using that game variable and start setting the value of TH::Enemy_Reposition.move_speed = 2 manually. This means, you'll be using that script call as many times as needed. Anyway, keep in mind it changes the speed of ALL ENEMIES. The other way is to simply forget about the starting value and make your favorite game variable the return value of the update_move_speed method. End of the Scripting Class
  8. Simply replace these parts of the code, and it should work normally. There's a caveat, you can't use a global variable that has not been initialized at that point. Thus you gotta pick any valid number instead. CODE UPDATED module TH module Enemy_Reposition @move_speed = 2 # $game_variables[4819] extend self attr_accessor :move_speed end end ... def update_move_speed TH::Enemy_Reposition.move_speed end The update_move_speed method can be found inside the Sprite_Battler class. Just go replace it at once.
  9. That's the problem here, the first condition sounds discouraging to say the least. :S
  10. kyonides

    Understanding RGSS

    Assignment != Equality && Assignment != Identity && Equality != Identity Let us review what an assignment actually is. It simply means that you pick either a Constant or a variable and set a value to that object and not any other around it. (Well, you could still do it but you got to have a valid reason for it or else do not even try to do that!) The assignment operator is an = equal sign. variable = actual_value That means that whenever you use that variable or Constant, it will always return the last value you have assigned to that particular object. You should not alter a Constant's value, though. :S Equality stands for something that has the save value as another object, be it a Constant or a variable. Use two == equal signs to make the comparison between two objects that might be different or not. CONSTANT = 1 @variable = 1 CONSTANT == @variable #=> Returns true The === identity operator! And finally, we got the identity operator === to help us define if an object has been placed on both sides of a given comparison. Here you got to be careful because it is excesively strict when looking for any identical value or object. range = 1..8 range === 5 #=> Returns true range === range #=> Returns... false! range == range #=> Returns... true! Object.new === Object.new #=> Returns false, they are two different Objects with their own IDs. Whenever you are using the case when statement to double check if a give variable is equal to another, it will use the === identity operator by default. As we could see in the first example of the identity checks, the first test returned a true-ish value because it used the === operator with EVERY SINGLE VALUE of that Range object until it hit number 5. Honestly, you should use the == equality operator for if and unless statements mainly because there is no specific reason to do otherwise. When using the case when statement, make sure you will be comparing the same kind of objects like numbers or classes. It will fail if you made a mistake and tested the value of a variable, like number 5, against a class like Integer, even if number 5 is an Integer object on its own right. Other Operators By the way, the != operator simply means Not Equal. The !=== Not Identical operator does exist as well, but it would be quite weird for you to find a good use for it anywhere. The && double et symbol you could find on the title of this very same post simply means and. A Terrible But Good Looking Error That Can Make You Break Your Head You will not be able to tell why it is not working as intended because it will make you think everything is fine. variable == 100 || 50 Yeah, everything looks terrific and it NEVER throws any error at your face at all. Really guys, it never will. 100% guaranteed! Still, it is a huge mistake under most circumstances. The reasoning behind it is QUITE SIMPLE indeed. How do you know if the test is always working as intended if it never fails? Keep in mind that any object other than nil and false are treated as true by default. So tell me why is that a problem for any novice scripter? It is a huge problem because you wound up defining a conditional statement you never needed. I mean, if you always get a true-ish value back, why bother at all? You could simply remove it and the script would work as usually does. But I need it to reject certain requests because it did not hit the 100% accuracy I need in my skill, item consumption, etc. If that is true, then you better delete the "|| number" part at once. I cannot. I need it to also work if it hits the 50% mark... You get a yellow card for making such a noob mistake then. Actually, the only way that would work is to define the condition like I do it right below this very same line. variable == 100 || variable == 50 I would suspect you come from a different programming language that allow you to do that or you simply watched some video tutorial that was not Ruby specific at all. Stop mixing language syntaxes right there! Don't do it ever again! It is for your own benefit, anyway.
  11. kyonides

    Understanding RGSS

    When to Use the Module Class' include Feature I have seen many times that people kind of abuse of the :: scope operator when they are fiddling with modules. That inspired me to revisit the modules to make sure they stop repeating themselves like crazy. Basic Setup Modules module SomeUser module Config DEFAULT_FONT_SIZE = 20 DEFAULT_TITLE = "Some Label" end end So far there is nothing new to see here but everything changes Shocked once we start dealing with a specific Window class. Detective Let us take a look at some fake Window_TitleCommand Add-on. class Window_TitleCommand alias :some_user_config_win_ttl_comm_draw_item :draw_item def default_font_size SomeUser::Config::DEFAULT_FONT_SIZE end def draw_item(index) some_user_config_win_ttl_comm_draw_item(index) contents.font.size = self.default_font_size text = SomeUser::Config::DEFAULT_TITLE contents.draw_text(4, 26, contents_width, 24, text, 1) end end As you can see above, we had to use the :: scope operator several times in our scriptlet. Happy with a sweat Honestly, I got to tell you that it is not elegant at all. Confused The more Constants you include the worse it will look like. Let's make some modifications to the original code. class Window_TitleCommand include SomeUser::Config alias :some_user_config_win_ttl_comm_draw_item :draw_item def draw_item(index) some_user_config_win_ttl_comm_draw_item(index) contents.font.size = DEFAULT_FONT_SIZE contents.draw_text(4, 26, contents_width, 24, DEFAULT_TITLE, 1) end end Wunderbar! Shocked Wonderful! Now it looks quite neat! And we can even skip the creation of needless methods only to call the same long line of code we could find inside the default_font_size over and over again. There is a caveat, though. You should NOT do that if you are working on a class that inherits the methods you have altered there. This is especially true if at least one of its child classes does not need such modifications at all. I seriously Serious recommend you to only include the modules in Baby child classes and nowhere else unless you know what you are doing.
  12. 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!
  13. 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.
  14. KyoAlert XP + VX + ACE + MV by Kyonides Introduction It simply displays a small notification alert somewhere on the screen depending upon the configuration of its KyoAlert module. The script will show it whenever you gained or lost any item, weapon, armor, or gold coins. It is possible to change the position of the icon and the item's name. There is a single script call, and it is used only if you want to display the fake Steam like alert. Use it for in game jokes! XD KyoAlert.achieve(ID) Screenshots Download Now! Terms & Conditions It's free as in beer. Include me in your game credits. Do Not Repost It!
  15. 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
  16. 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...
  17. kyonides

    KyoAlert XP-MV

    KyoAlert XP through VX Ace Have Been Updated!
  18. 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

  19. kyonides

    KyoAlert XP-MV

    A New Port Has Arrived! Now MV can also enjoy the benefits of using the KyoAlert plugin!
  20. 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

  21. kyonides

    Understanding RGSS

    This thread will be one of those basic tutorials that will start by telling you the basics of crafting scripts on your own. In the worst case scenario, you will be able to make minor edits without much help from actual scripters. Basic Concepts object - pretty much anything in Ruby and RGSS, including numbers to some degree. It is the basic building lego block. value - almost identical to object but it refers to what is actually returned by some script call, a method, etc. It is or might be contained by a variable. variable - x or y or z are common examples of variables used frequently in Ruby or RGSS scripts. They are the containers of any specific value / object. They can easily be treated as methods depending on how you have defined your custom class or module. method - sometimes also known as attribute, a basic component of a class or module. They are attached to its class or module. 1.to_s calls the convert to string method, turning it into "1" at once. Now you can use it on any window! class - a Class that can be initialized or constructed via the new method. module - a Module that is used as a container. It is not supposed to be used as a class for you cannot make any copies of it. It will always keep all of its internal variables intact till you close your game. Not even loading a different saved game will alter it by default. NOTE: Module itself is a class but one that cannot be initialized nor constructed by using new. All attempts to do such things will certainly fail. When Should You Use a Class or a Module? Pick a class if you need to make copies of tha object like Actors or Enemies or Items. Use or call a module if you want to use system wide functions that might alter your game somehow. The best example would be the Graphics module. Call Graphics.resize_screen(W, H) on RGSS3 (ACE) and you will be able to increase or decrease the window size a little bit. NOTE: $game_temp or Game_Temp class could have been easily be defined as a Game_Temp module for all of its methods and internal values are temporary by nature and you don't need multiple copies of it. When NOT to Use a Class You don't need to create a new class if an Array or Hash object can easily help you with storing its values. Module's Special Feature It is definitely true that you cannot initialize a Module, meaning that you will ever get a copy of it. Yet, you can easily mix it into a Class. From that moment all most of its variables and methods become the new methods of that specific Class. Let us take a look at the following example of how you are supposed to define a module and also a brand new class. module Test def running? true end end class Maker include Test end Did you see that include Test statement over there? It means that Test has become an integral part of Maker class. Now you can call it like this: klass = Maker.new klass.running? And it will return true as it current value. What is true? Anything that has been confirmed or exists, a truthy value. Am I getting philosophical here? Well, kind of. true represents what is really there, what can be found as many times as needed. What happens if it is a lie or is incorrect or does not exist at all? Then it would be false. Obviously false is the opposite of true just as much as a lie is the opposite of the truth. A Caveat Has Been Found! Ruby and RGSS have a weird but not so unusual feature in programming languages, namely the nil value. Basically, nil is its official non existing value, even if its a value on its own right. XD Curiously, it also works as a substitute for a false value in many cases. Whenever an object does not exist because it has never been called or defined as a variable or class or module, it is certainly equal to nil. Now comes the most intriguing feature that has been bugging you ever since you began reading this tutorial... What the hell is that stupid dot . doing there? Nope, it is not just a punctuation mark. It is a connection! It connects the method to its own class or method or variable or even to its number value. OK... What does def stand for? Short answer: definition. It allows you to define a class or module's method. And before you even ask it, know that the term end means, well, end! XD It marks the end of the century! OK, nope. It is the end of a method or class or module definition. That's all, folks!
  22. 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]
  23. 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.
  24. 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.
  25. 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.
×
Top ArrowTop Arrow Highlighted