[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,787
Reaction score
939
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,787
Reaction score
939
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

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top