Jump to content
Chaos Krux

Advanced Confusion State?

Recommended Posts

Posted (edited)

Oh boy, back again... If it wasn't apparent how comically inept I am at coding and scripting, here's more proof~ I do feel quite bad continuously asking for so much, but of course you're all quite welcome to just ignore this and go about you day~

I'll get to the point. I'm sure most of you know that Confusion in RPG Maker makes the victim attack any, be it their allies or their enemies, regardless of player input. I have altered my version of confusion so that the victim always targets their allies, and this state works well for a majority of the game. However, I was wondering if there might be away to improve the effect of confusion beyond simply attacking one's allies. More specifically, I would like to create an alternative version of the confusion state (perhaps named something like infatuation) that causes the victim to actually use their abilities instead of simply using their normal attack. Even more specific than that, I'd like the victim to be able to use positive spells, such as buffing or healing spells, and perhaps even items on their enemies. It would be completely fine if this effect replaced the effect of causing victims to attack their allies. Essentially this status would turn its victim into a source of buffs and healing for the enemy team. Think Brainwash from Persona or Confusion in certain Final Fantasy Games. I am almost positive that such an elaborate setup would need a script, but I have been unable to find anything of the sort so far. So I thought I'd try my luck here. As always, any and all help any of you could give me would be very much appreciated~

Edited by Chaos Krux
Examples for Reference

Share this post


Link to post
Share on other sites

Really 'confusion' status usually implies being confused about what is an ally and what isn't and/or scrambling the player's controls. What you are talking about I am pretty sure is usually called 'charm' I think. Actually in my game I have a charm status that petty much works exactly like you describe, but I am using my own battle system/enemy AI system and it doesn't work in the default battle system. Also it only effects enemies right now anyway since I have no AI code on the player's end.

 

I will tell you one thing though: The basic idea about how my charm status worked is that it mostly just swaps the @friends_unit and @opponents_unit when creating a Game_Action object. With the default battle system the status might be able to work by doing that and setting a actor's 'auto battle' flag.

Share this post


Link to post
Share on other sites

Now I've been confused~ This is the problem with asking for help from people smarter than me~ I really have no idea how I would go about swapping those two things or anything like that without breaking the game by accident. I'm sure that probably would work if I knew how to do it, but I'm really quite a novice at anything to do with code. Thanks for your time, though~ Perhaps I might look into it, but I doubt I could get it to work.

Share this post


Link to post
Share on other sites

After much trial and error and a long time of searching, I have managed to find a script that performs quite well. While it's not perfect, it does what I wanted it to do well enough. Thank you for your time anyway~

Share this post


Link to post
Share on other sites
Posted (edited)

I am curious too!

 

Edit: Also sorry for confusing you... To be honest I find the whole way the battle system works in VX Ace a bit confusing myself. Mostly because everything is scattered about different places and it can be hard to find what you want.

Edited by Kayzee

Share this post


Link to post
Share on other sites

I've seen a few scripts that can do this-I've not tried any of them personally.

So, I'm curious as to which one you found.

Share this post


Link to post
Share on other sites

Yikes, this is unfortunate. I hate to beat a dead horse, but it turns out DoubleX's script has a pretty major flaw that I only just noticed... It, for some undetermined reason, causes any combat abilities that use common events to stop working altogether. The game acts as if no action was inputed at all. It doesn't even take any MP or TP away from the user. This is particularly annoying since I have a summoning system that works almost exclusively through common events. I've had to remove the script for now, and the abilities work like normal again. I realise it's been a while since I originally posted this question, but if anyone could find a solution that would allow me to use this script without it breaking the game, that would be very much appreciated. I have saved the script to my computer elsewhere, so I can put it here if anyone needs it.

Share this post


Link to post
Share on other sites

Hmmm...
Might be a good idea to do that (in a spoiler), just because that makes it easier for us to analyze and type responses, all on one page!

Share this post


Link to post
Share on other sites
3 hours ago, Chaos Krux said:

Yikes, this is unfortunate. I hate to beat a dead horse, but it turns out DoubleX's script has a pretty major flaw that I only just noticed... It, for some undetermined reason, causes any combat abilities that use common events to stop working altogether. The game acts as if no action was inputed at all. It doesn't even take any MP or TP away from the user. This is particularly annoying since I have a summoning system that works almost exclusively through common events. I've had to remove the script for now, and the abilities work like normal again. I realise it's been a while since I originally posted this question, but if anyone could find a solution that would allow me to use this script without it breaking the game, that would be very much appreciated. I have saved the script to my computer elsewhere, so I can put it here if anyone needs it.

I failed to reproduce this issue using just the confusion edit script and a skill with common events, so I guess that it's a compatibility issue. As I don't know what's the summoning system script you're using, I'd be glad if you mention which or even just send me your project so I can check the issue myself :)

Share this post


Link to post
Share on other sites
Posted (edited)

I'm actually not using a script for my summoning system, it's all done through common events and troop scene events. I'm far better at using common events than coding, you see. I am unfortunately unable to provide a copy of my game since the laptop I'm currently using is unable to condense it. My apologies for the inconvenience, but the best I would be able to do is provide a list of all the scripts I have in my project. I realise this may not be particularly efficient, but I really have no better alternative at this time.


 

Spoiler

Confusion Edit by DoubleX

Yanfly - 

Ace Core Engine

Ace Message System

Class System

Class Specifics

Party System

Party System Add-On - Command Party

Ace Battle Engine

Battle Engine Add-On - Enemy HP Bars

Combat Log Display

Command Autobattle

Command Equip

Enemy Target Info

Battle Command List

Element Absorb

Victory Aftermath

Ace Equip Engine

Enemy Levels

Enemy Levels Add-On - Doppelganger

Input Combo Skills

Learn Skills Engine

Skill Cost Manager

Skill Restrictions

Target Manager

Steal Items

Ace Item Menu

Ace Save Engine

Save Engine Add-On - New Game +

Active Battle Advantage

Event Chase Player

Ace Shop Options

System Options

Anti-Fail Message

 

Other -

Extend Troops by Hime

Quest Log by Lizzie S, Moonpearl and RGangsta

Jukebox Script by ninjamida

Auto-Life by Mr.Bubble

Invader Mini Game by Galv

Battle Weather Effects by Dekita

 

I also have small snippets of code that aren't full scripts but do change certain things about the game.

Spoiler

Enemy Targeting Snippet:



class Game_Action
  def targets_for_friends
	if item.for_user?
	  [subject]
	elsif item.for_dead_friend?
	  if item.for_one?
		[friends_unit.smooth_dead_target(@target_index)]
	  else
		friends_unit.dead_members
	  end
	elsif item.for_friend?
	  if item.for_one?
		if @target_index < 0
		  [friends_unit.random_target]
		else
		  [friends_unit.smooth_target(@target_index)]
		end
	  else
		friends_unit.alive_members
	  end
	end
  end
end

 

Spoiler

Zombie State Snippet:



class Game_BattlerBase
  def rec; check_for_zombie ? sparam(2) * -1 : sparam(2); end
  def hrg; check_for_zombie ? (check_for_poison ? xparam(7) : xparam(7) * -1) : xparam(7); end
  def check_for_poison; @states.include?(2) || @states.include?(51); end
  def check_for_zombie; @states.any? {|st| $data_states[st].zombie}; end
  #def rec; check_for_zombie ? sparam(2) * -1 : sparam(2); end
  #def hrg; check_for_zombie ? xparam(7) * -1 : xparam(7); end
  #def check_for_zombie; @states.any? {|st| $data_states[st].zombie}; end
end


class RPG::State < RPG::BaseItem
  ZOMB = /\[zombie\]/i
  attr_reader :zombie
  
  def set_zombie
    return if @zombie_check; @zombie_check = true
    @zombie = false
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when ZOMB
        @zombie = true
      end
    end
  end
end

module DataManager
  class << self
    alias load_database_cpz load_database unless $@
  end
  
  def self.load_database
    load_database_cpz
    check_zomb
  end

  def self.check_zomb
    groups = [$data_states]
    for group in groups
      for obj in group
        next if obj == nil
        obj.set_zombie if obj.is_a?(RPG::State)
      end
    end
  end
end

 

 

I imagine a majority of these scripts will have absolutely no impact on yours whatsoever, but I just wanted to be safe and list them all. I apologise again for it being so much at once.

 

I should also say I didn't mean to cause any offence. I'm sure this issue has less to do with your script and more to do with something else.

Edited by Chaos Krux
Spellings

Share this post


Link to post
Share on other sites
Posted (edited)
21 hours ago, Chaos Krux said:

list of all the scripts

I don't see confusion edit in the list. Which one is it? If you didn't list it, then add it in. It helps to know where in the list it is located.

I assume of course that this is your script order and not just a random list of you scripts.

 

Edited by roninator2

Share this post


Link to post
Share on other sites
1 hour ago, roninator2 said:

I don't see confusion edit in the list. Which one is it? If you didn't list it, then add it in. It helps to know where in the list it is located.

I assume of course that this is your script order and not just a random list of you scripts.

 

also

That does have a rude tone to it. Best to just delete it.

My apologies, it wasn't supposed to be rude~ I just have a habit of using phrases such as that. I'll also at DoubleX's script to the list. Thanks

Share this post


Link to post
Share on other sites

It seems to me that the key lies on those common events and troop scene events you've made to implement your summoning system. I guess that some screenshots showing those events can help here :)

Share this post


Link to post
Share on other sites
Posted (edited)

What's really interesting to me is this line:

On 6/3/2020 at 5:34 PM, Chaos Krux said:

The game acts as if no action was inputed at all. It doesn't even take any MP or TP away from the user.

 

Do the skills in question have any other effects besides calling common events? Do they work if given one? Calling a common event is done differently to how other effects work, so I wonder if something is causing skills without any normal effects/damage to be ignored?

 

More technically, MP/TP costs are paid and common events are set up in the same place, the battler's 'use_item' method. If for some reason this isn't called for some skills, the result will be no MP/TP gets taken away and common events are not run.

 

Edit: Also might have to do with the skill's scope if it's set to 'None'.

Edited by Kayzee

Share this post


Link to post
Share on other sites
5 hours ago, Kayzee said:

What's really interesting to me is this line:

 

Do the skills in question have any other effects besides calling common events? Do they work if given one? Calling a common event is done differently to how other effects work, so I wonder if something is causing skills without any normal effects/damage to be ignored?

 

More technically, MP/TP costs are paid and common events are set up in the same place, the battler's 'use_item' method. If for some reason this isn't called for some skills, the result will be no MP/TP gets taken away and common events are not run.

 

Edit: Also might have to do with the skill's scope if it's set to 'None'.

The skills I'm talking about do not have any other effects besides running the common events, no. However, they have all worked flawlessly up until I added the confusion edit script. 

Share this post


Link to post
Share on other sites
14 hours ago, DoubleX said:

It seems to me that the key lies on those common events and troop scene events you've made to implement your summoning system. I guess that some screenshots showing those events can help here :)

Very well, I shall take some screenshots of the events in question and leave them below. As I've said before, the summoning system and teleport system have both worked perfectly well until now,, so I'm not entirely sure what would be causing an issue. Either way, here:

Spoiler

Teleport:

image.png.c18fa1499b875e0777bf8cecacd87fd8.png

 

Summoning Common Events:

Summon Call (When Summon Ability is used):

image.thumb.png.e95821a9ac3b9de48950a07ed4e0e445.png

 

Summon Dismiss (When the Summon is either Dismissed or Defeated):

image.thumb.png.729af7af006b3bb2f0006372cddca98c.png

 

Summon End (Runs if the Summon is still present when the Battle Ends)

image.thumb.png.dd6a3b9bebdb448d830209439c976c38.png

 

Summoning Troop Event (Used in every Troops Scene):

image.png.ebf0eca0bce8bb88d264492e93871ae2.png

 

Please note that a version of each common event exists for each of the game's different summons. The troop event displayed above also features identical snippets for each summon as well. I simply showed one example of each event for the sake of convenience and time.

 

I hope this is helpful~

 

By the way, I am aware that there probably is a more efficient method of setting up a summoning system, but none of the scripts I tried for that purpose seemed to work for me and this setup has worked just as I wanted it do since I first implemented it, so I'm fine with this.

Share this post


Link to post
Share on other sites
On 6/3/2020 at 5:34 PM, Chaos Krux said:

for some undetermined reason, causes any combat abilities that use common events to stop working altogether.

I wonder if those common events would run if the battle was over? This is something I noticed from the menu. Some items that I have common events running on, will only take effect when exiting the menu and going to the map.

To work around this I put in Hime's Scene Interpreter script. Added the comment on the common event and presto, all good again.

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, roninator2 said:

I wonder if those common events would run if the battle was over? This is something I noticed from the menu. Some items that I have common events running on, will only take effect when exiting the menu and going to the map.

To work around this I put in Hime's Scene Interpreter script. Added the comment on the common event and presto, all good again.

Hm... Not exactly ideal to fix an issue with one script by adding another, but if you think that would help I might try it. I wouldn't mind this happening as much if the common events had always been faulty. The only reason this is even an issue to begin with is that they worked fine before.

 

In terms of common events running after battles are over, I have experienced this too. However, in all my testing of anything ever, common events that are linked to abilities always seem to run during battle. It's only common events that are linked to switches that seem to run after battle. That's how my summoning system works actually. The only reason the summon doesn't disappear immediately after it is summoned is that the common event which ends the summon is linked to a switch, meaning it triggers after the battle is over. But the abilities that actually carry out the summon should run the common events during battle...

Edited by Chaos Krux

Share this post


Link to post
Share on other sites
Posted (edited)
8 hours ago, Kayzee said:

Also might have to do with the skill's scope if it's set to 'None'.

Hey, look at that, you were right~ Again~

 

I just tried changing the scope all the abilities that were breaking so that they are now not set to "none". I originally set them to none because they were running common events and have no effect on the actors or enemies themselves. Turns out, that was the problem. The abilities all seem to work just fine again now, so thanks a bunch~ I imagine it probably broke since DoubleX's script affects battle targets for abilities, so abilities that are set to none might interfere with that somehow? Either way, your assistance is appreciated, everybody.

 

As a side note, this doesn't affect me since I don't use it, but since DoubleX is here I might as well bring it up. The "Ignore Self" command seems to crash the game if the victim of the status effect is the only target available. I had it happen once where a party member tried to use a damaging ability on its allies while all its allies were dead, which caused the game to softlock. As I said, it doesn't really bother me, and it's entirely possible it's just something to do with the other scripts I have, and/or even just me being dumb again in some way. Still, I thought I'd mention it.

Edited by Chaos Krux

Share this post


Link to post
Share on other sites

Yeah; the 'none' scope is actually not one hundred percent bug-free with just the default scripts only.
Explaining why is not something I can do without making things complicated and far out of topic scope, but yeah, let us just say that it's best to use 'none' for passive ability skill links, since those skills are not actively used, at all.

Share this post


Link to post
Share on other sites
6 hours ago, Chaos Krux said:

Hey, look at that, you were right~ Again~

 

I just tried changing the scope all the abilities that were breaking so that they are now not set to "none". I originally set them to none because they were running common events and have no effect on the actors or enemies themselves. Turns out, that was the problem. The abilities all seem to work just fine again now, so thanks a bunch~ I imagine it probably broke since DoubleX's script affects battle targets for abilities, so abilities that are set to none might interfere with that somehow? Either way, your assistance is appreciated, everybody.

 

As a side note, this doesn't affect me since I don't use it, but since DoubleX is here I might as well bring it up. The "Ignore Self" command seems to crash the game if the victim of the status effect is the only target available. I had it happen once where a party member tried to use a damaging ability on its allies while all its allies were dead, which caused the game to softlock. As I said, it doesn't really bother me, and it's entirely possible it's just something to do with the other scripts I have, and/or even just me being dumb again in some way. Still, I thought I'd mention it.

For actions having no targets, the confusion edit script has fixed the bug for not executing such actions in the latest version(v1.02f).

As for the crash coming from the ignore self case, I failed to reproduce the issue(the action's just not executed at all which is intended due to the action actually having no targets while it should've at least 1), so I guess that it's a compatibility issue :)

Share this post


Link to post
Share on other sites
15 hours ago, DoubleX said:

For actions having no targets, the confusion edit script has fixed the bug for not executing such actions in the latest version(v1.02f).

As for the crash coming from the ignore self case, I failed to reproduce the issue(the action's just not executed at all which is intended due to the action actually having no targets while it should've at least 1), so I guess that it's a compatibility issue :)

 

I imagined it might be. As I said, I'm not using that feature so it doesn't effect me. And even if it did, it's clearly nothing that's wrong with your script. Trns out there was never really anything wrong with it to begin with. Just my own incompetence again~ Sorry~

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×