[VX Ace]Yami's ATB Lunatic CATB start question

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello, I have a question

I'm using Yami's Classic Actime Time battle script and an add-on called Lunatic CATB Start and I want to make a starting formula tag allows me to make the start rate is from 0 to X%, I tried to create a new method in the CATB Start script, but it doesn't work, can some help me to make what I want to do?


The method I tried to create, based in this's script start battle tag is the next one


#----------------------------------------------------------------------
# ATB Starter Formula No.1: RANDOM START BATTLE
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set starting ATB to X percent.
#
# Formula notetag:
# <custom catb start: rand start battle x%>
#----------------------------------------------------------------------
when /RAND START BATTLE[ ](\d+)([%%])/i
@catb_value = MAX_CATB_VALUE * rand($1.to_i) / 100


However, it works exactly the same as Start battle one, can someone help me to change this one? Thank you :)

P.D: I tried to use the custom catb start string format, but I'm not sure how to make it work
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,769
Reaction score
935
First Language
Chinese
Primarily Uses
N/A
Hello, I have a question

I'm using Yami's Classic Actime Time battle script and an add-on called Lunatic CATB Start and I want to make a starting formula tag allows me to make the start rate is from 0 to X%, I tried to create a new method in the CATB Start script, but it doesn't work, can some help me to make what I want to do?


The method I tried to create, based in this's script start battle tag is the next one



#----------------------------------------------------------------------
# ATB Starter Formula No.1: RANDOM START BATTLE
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set starting ATB to X percent.
#
# Formula notetag:
# <custom catb start: rand start battle x%>
#----------------------------------------------------------------------
when /RAND START BATTLE[ ](\d+)([%%])/i
@catb_value = MAX_CATB_VALUE * rand($1.to_i) / 100


However, it works exactly the same as Start battle one, can someone help me to change this one? Thank you :)

P.D: I tried to use the custom catb start string format, but I'm not sure how to make it work
I guess it's because the way you've written your custom notetag.


Specifically, if the notetag matches this:


/RAND START BATTLE[ ](\d+)([%%])/i


It'll also match this:


/START BATTLE[ ](\d+)([%%])/i


So if the latter's placed above the former in the same case, the former will never be ever reached no matter what notetags you've written in the notebox.


To fix that, you can simply place the former above the latter :)
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
I guess it's because the way you've written your custom notetag.


Specifically, if the notetag matches this:



/RAND START BATTLE[ ](\d+)([%%])/i


It'll also match this:



/START BATTLE[ ](\d+)([%%])/i


So if the latter's placed above the former in the same case, the former will never be ever reached no matter what notetags you've written in the notebox.


To fix that, you can simply place the former above the latter :)


If we go under that logic, the tags before /START BATTLE wouldn't work either, because they work with the same syntax


when /FIRST STRIKE[ ](\d+)([%%])/i
when /NONE STRIKE[ ](\d+)([%%])/i




However, I DID modify the /START BATTLE one as the one I tried to create, and it works as I want now lol


So... I guess it's solved? I'd like to have the fixed start rate just in case though
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,769
Reaction score
935
First Language
Chinese
Primarily Uses
N/A
If we go under that logic, the tags before /START BATTLE wouldn't work either, because they work with the same syntax



when /FIRST STRIKE[ ](\d+)([%%])/i
when /NONE STRIKE[ ](\d+)([%%])/i




However, I DID modify the /START BATTLE one as the one I tried to create, and it works as I want now lol


So... I guess it's solved? I'd like to have the fixed start rate just in case though
Actually it's not just about having the same syntax, but their ordering also matters.


For instance, it's completely okay to have these:


when /RAND START BATTLE[ ](\d+)([%%])/i
# Do something
when /START BATTLE[ ](\d+)([%%])/i
# Do something


Because meeting the former implies meeting the latter while the former's checked before checking the latter.


On the other hand, this will have problems:


when /START BATTLE[ ](\d+)([%%])/i
# Do something
when /RAND START BATTLE[ ](\d+)([%%])/i
# Do something


Because this time meeting the latter implies meeting the former while the former's checked before checking the latter.


Also, what you've mentioned doesn't really have the same syntax:


when /FIRST STRIKE[ ](\d+)([%%])/i
when /NONE STRIKE[ ](\d+)([%%])/i


Because neither the former's a part of the latter nor the latter's a part of the former.


If you want to know more, you want be interested in regular expressions :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

So I need to come up with quite a few action sequences.
Was stressing about this plugin earlier, but pretty happy with how its looking now! Purple makes it pop more too!! :)
A friend requested me to do a pfp for his twitch channel, so far he approved one of my sketches, so going to digital now. The style he's looking for is quite different from my usual, hopefully I can get it right... :kaoback:
I am so hyped! A new post update and im anxious to see reactions..eeeeeeee

Forum statistics

Threads
105,479
Messages
1,014,044
Members
137,126
Latest member
IDontEvenKnow
Top