DoubleX RMVXA Input Addon to YSA Battle System: Classical ATB

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A

DoubleX RMVXA Input Addon v1.00b to YSA Battle System: Classical ATB


by DoubleX




Prerequisites


DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB


YSA Battle System: Classical ATB(Created by Yami)


Introduction


Lets users run their script codes right before/after inputting actions

Spoiler




# RGSS3 codes stored as string form in PRE_ATB_INPUT will be evaluated right # before inputting actions PRE_ATB_INPUT = "" # RGSS3 codes stored as string form in POST_ATB_INPUT will be evaluated # right after inputting actions POST_ATB_INPUT = ""



Features


Fixed RGSS3 script codes as configuration values

How to use
Open the script editor and put this script into an open slot between the script DoubleX RMVXA Bug Fixes to YSA Battle System: Classical ATB and Main. Save to take effect.

FAQ
None

Credit and Thanks
DoubleX(Giving me credit is completely optional)
The terms of use are the same as that of YSA Battle System: Classical ATB except that you must also give Yami credit(you should do this anyway) if you give DoubleX or his alias credit

Compatibility
Same as that of YSA Battle System: Classical ATB
 
Changelog


v1.00a(GMT 1400 25-5-2014):


- 1st version of this script finished


View attachment (DoubleX)YSA CATB Input Addon v1.00a.rar
 
Last edited by a moderator:

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
I was just wondering if it would be possibile to check if any of the enemies in battle had a specific state and if not add that state to only 1 enemy random or targeted who was still alive. So that one state would continually be active on one enemy at a time in battle?


I am using this script, you helped me write this code earlier. I was wondering if it was possible to keep this code, and also add some if statements for the enemies.

  POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                      end"
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A
I was just wondering if it would be possibile to check if any of the enemies in battle had a specific state and if not add that state to only 1 enemy random or targeted who was still alive. So that one state would continually be active on one enemy at a time in battle?


I am using this script, you helped me write this code earlier. I was wondering if it was possible to keep this code, and also add some if statements for the enemies.

  POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                      end"

The same applies to enemies as well, just note that there can be more than 1 enemy instance sharing the same id. For instance:

Code:
  POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                      elsif @subject.enemy?
                          if @subject.index == 1
                            # Do something
                          elsif @subject.index == 2
                            # Do something else
                          end
                      end"
 

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
How would I write in code in the format you layed out for me.  If any enemy has state 66 do nothing else add state 66 to only one of the enemies. Is it possibile to write something like this? Take your time I know you are very busy! This helps me so much! If I can get this working my battle pet should be able to be included in the game!

Code:
[COLOR=rgb(0,0,0)] POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                      elsif @subject.enemy?
                          if @subject.index == 1
                            # Do something
                          elsif @subject.index == 2
                            # Do something else
                          end
                      end"[/COLOR]
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A
How would I write in code in the format you layed out for me.  If any enemy has state 66 do nothing else add state 66 to only one of the enemies. Is it possibile to write something like this? Take your time I know you are very busy! This helps me so much! If I can get this working my battle pet should be able to be included in the game!



POST_ATB_INPUT = "if @subject.actor?
if @subject.id == 1
@subject.add_state(75)
elsif @subject.id == 2
@subject.add_state(76)
elsif @subject.id == 3
@subject.add_state(77)
elsif @subject.id == 4
@subject.add_state(78)
elsif @subject.id == 5
@subject.add_state(79)
end
elsif @subject.enemy?
if @subject.index == 1
# Do something
elsif @subject.index == 2
# Do something else
end
end"

You may want to try this:

Code:
alive_mems = $game_troop.alive_members
if alive_mems.none? { |mem| mem.state?(66) }
  alive_mems[rand(alive_mems.size)].add_state(66)
end
 

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
I tried this
    POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                        alive_mems = $game_troop.alive_members
                        if alive_mems.none? { |mem| mem.state?(66) }
                          alive_mems[rand(alive_mems.size)].add_state(66)
                        end
                      end"


and I tried putting elsif before alive_mems = $game_troop.alive_members both times it didnt do anything.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A
I tried this
    POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                        alive_mems = $game_troop.alive_members
                        if alive_mems.none? { |mem| mem.state?(66) }
                          alive_mems[rand(alive_mems.size)].add_state(66)
                        end
                      end"


and I tried putting elsif before alive_mems = $game_troop.alive_members both times it didnt do anything.

How about this?

Code:
    POST_ATB_INPUT = "if @subject.actor?
                        if @subject.id == 1
                          @subject.add_state(75)
                        elsif @subject.id == 2
                          @subject.add_state(76)
                        elsif @subject.id == 3
                          @subject.add_state(77)
                        elsif @subject.id == 4
                          @subject.add_state(78)
                        elsif @subject.id == 5
                          @subject.add_state(79)
                        end
                      end
                      alive_mems = $game_troop.alive_members
                      if alive_mems.none? { |mem| mem.state?(66) }
                        alive_mems[rand(alive_mems.size)].add_state(66)
                      end"
 

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
That works perfect I wonder if I could just add a small condition to the end piece you wrote.

 


alive_mems = $game_troop.alive_members
if alive_mems.none? { |mem| mem.state?(66) }
alive_mems[rand(alive_mems.size)].add_state(66)
end"




Can I make it so this happens only if a specific switch is on? Or perhaps only if a current actor is present? Some kind of condition so I can stop it from occurring in certain fights?

Something like If@subject == 1 is present
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A
That works perfect I wonder if I could just add a small condition to the end piece you wrote.

 



alive_mems = $game_troop.alive_members
if alive_mems.none? { |mem| mem.state?(66) }
alive_mems[rand(alive_mems.size)].add_state(66)
end"




Can I make it so this happens only if a specific switch is on? Or perhaps only if a current actor is present? Some kind of condition so I can stop it from occurring in certain fights?

Something like If@subject == 1 is present
Code:
if $game_switches[x] # Or change it to if @subject.actor? && @subject.id == 1
  alive_mems = $game_troop.alive_members
  if alive_mems.none? { |mem| mem.state?(66) }
    alive_mems[rand(alive_mems.size)].add_state(66)
  end
end"
 

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
Works Like a charm! In your honor I am going to be uploading a video soon! Hopefully it gets people hyped for this game! Spending so much time on it. Will not be finished for a longtime yet but I think that is what will make it worth playing. So glad to use your coding my good friend. I wish you the best.
 

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
Hello DoubleX I currently use this for my pre_atb input:

PRE_ATB_INPUT = "add_state(74) if actor?"

Basically I have a state animation that makes the actor blink. However this overwrites other cool state animations I have playing. I was wondering would it be possibile to use code, to instead loop an animation until an action is selected and target confirmed? So I could essentially have a poison state or buff state still playing but have the blinking effect indicating characters turn all the same.

If Looping an animation isn't available would it be possible to just play an animation once?

Please let me know if that makes sense. Thanks so much for all your help!
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A
Hello DoubleX I currently use this for my pre_atb input:

PRE_ATB_INPUT = "add_state(74) if actor?"

Basically I have a state animation that makes the actor blink. However this overwrites other cool state animations I have playing. I was wondering would it be possibile to use code, to instead loop an animation until an action is selected and target confirmed? So I could essentially have a poison state or buff state still playing but have the blinking effect indicating characters turn all the same.

If Looping an animation isn't available would it be possible to just play an animation once?

Please let me know if that makes sense. Thanks so much for all your help!

As it's almost certainly a compatibility issue, I think you'll at least have to list all the scripts you're using, with their ordering preserved :)
 

nazgul

Husband
Veteran
Joined
Jul 23, 2015
Messages
116
Reaction score
39
First Language
english
Primarily Uses
Sorry I was asking if their was ruby code I could use in the  PRE_ATB_INPUT = "_______________" That would loop an animation on the current player.
Basically I noticed in Final Fantasy 4 actors could have an animated state like sleep, and still blink when it was there turn. In my game I made a state with a blinking animation to indicate the turn of the player, but it overides all my other animated states. I was curious if it was possibile to have a state animation on and still loop an animation on the actor pre atb input.


As for the relevant scripts I think it would be:

State Animations
https://yanflychannel.wordpress.com/rmvxa/battle-scripts/state-animations/
Battle Engine Symphony

https://github.com/suppayami/rmvxa-collection/blob/master/battle-symphony/battle-symphony-116e.rb
Yami's ATB
https://yamiworld.wordpress.com/rgss3/battle-scripts/yeas-add-on/ysa-battle-system-classical-active-time-battle/
I also use some of your fixes and various ad ons for this.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,830
Reaction score
978
First Language
Chinese
Primarily Uses
N/A
Sorry for my late reply, but I think you may want to try the update addon instead.


Be warned though, misusing this addon can lead to serious constant lag and fps drop :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Ami
need a time to not open my MV,still addicted with new vegas

i wonder what addiction effect behind playing new vegas too much,maybe INT & Science gone worse in many days :D
cdjensen94 wrote on Kaliya's profile.
Are you the one who develops Kaliya's Visual Map Enhancements. If so I desperately need some help. I bought the plugin back a few months. I've only started using it recently.
Cause MP Damage instead of HP, Localization Plugin for Translation | RPG Maker News #112

Here in Fla were are seeing crazy covid spikes and some vaccinated getting bad infections. I had a mild fever on Thurs but it went down fast. How is everyone else doing. Hopefully you are all well. :)
Wish I was better at art, specifically that I was faster at it, bc this one NPC took Several Days to complete! It's gonna take So Extremely Long to do all of the art for my game, never mind writing it... Anyways, here's my gorgon, Hopernica Sthyxis!

57b88732c7abbcd84981dacf624a98495af61fcc.gifv

Forum statistics

Threads
113,829
Messages
1,077,756
Members
147,886
Latest member
NewMike
Top