custom skill cost problem

Hello, I'm using Yanfly's skill cost manager and ran into a problem while trying to make a custom cost.

So basically, I want to make a skill usable only when actor with id 2 is in battle, and take tp from both actors (actor 1 uses the skill):
the skill note looks like this:
<custom cost: 100>
<custom cost colour: 0>
<custom cost requirement>
$gameActors.actor(2).isBattleMember()
</custon cost requirement>
<custom cost perform>
$game_actors[1].tp - 100
$game_actors[2].tp -100
</custom cost perform>

when I try to see the cost in skill menu in the game I get this error:
Script 'Skill Cost Manager' line 577: SyntaxError occured.
unterminated regexp meets end of file

the problem is in the custom cost requirement, when I take it out the cost shows but I need this requirement for the skill to make sense.

If there is some information missing, I will provide it.

Thanks in advance for the help!
it would help to see screenshots of both the notetag and the console output of the error message.

because "un-terminated" means that you opened a notetag and didn't close it.
and half the times in the past that was a typo that the user corrected when rewriting in the forum, which is why the screenshot of the notetag (to see if you have such a typo) is important.

and the full console output gives more details about the error trace than just that short message.

EDIT:
sorry VXA doesn't have the error trace by default, you'll need to install a backtracer script to get that into the console.
a link to a backtracer is in my "how to use a script" tutorial linked in my signature
I'll send the things you asked for in around 10 hours. I really need to get some sleep, sorry for the inconveniance
Just to mention it, this is the wrong forum. VX Ace doesn't use JavaScript or plugins, only RGSSS3 scripts. You might want to report your post and ask a mod to move it, you could get more responses from people subscribed to the Ruby forums.
I missed the placement of the topic as pointed out by ATT_Turan, but this also shows what the cause of the missing termination is:
SyntaxError occured.
You've used the javascript equivalent of the check, which is nonsense to VXA
$gameActors does not exist for Ace, you'll need to use the Ace/Ruby equivalent of that check for isBattlemember.
And because your notetag contained nonsense letters, it was never fully processed and closed.
I didn't know that, I'll report right away.

So, I fixed a typo (you were right - it was a typo) but now I got the problem with the wrong check.
so, how do I do this in Ace/Ruby? I just want to check if the actor is in the active party/battle party.

I found this in the game script:
$game_party.battle_members.include?(self)
The game stops crashing but the conditions are never met ( i put id 2 in the (self) spot but I think I'm using this wrong)


This is the backtrace of the error I have now ( with $gameActors.actor(2).isBattleMember() in the custom cost requirement):
obraz_2022-02-13_113501.png

And the notetag on the skill:
obraz_2022-02-13_113631.png
do the script functions work with index or ID?
because in most cases the index starts at 0, not 1, and that would make index 2 = third actor, not second and crash in case of a two actor party.
And that includes the "undefined actor if the specific actor does not exist.
I have no idea but even if it starts from 0 actor 3 is in the battle party when I'm testing so It should still work.

I'm not experienced in this kind of stuff so I don't know what will work and what won't

Hoping somebody knows the answer
I have no idea but even if it starts from 0 actor 3 is in the battle party when I'm testing so It should still work.
You're still using Javascript notation in your custom cost requirement. The Ruby equivalent is

$game_actors[2].battle_member?
It worked! Now I can continue making my project :>

Thank you very much Andar ATT_Turan and Trihan for your time and help! 😀
Hello again, I ran into another problem while doing the same custom cost: the tp.

so another requirement to this skill is that both actors 1 and 2 have at least 100 tp
and in cost perform it would take the 100 tp from both actors.

Am I using JavaScript again or is it something else this time?
notetag on the skill:
obraz_2022-02-14_002807.png

And the error in the console:

obraz_2022-02-14_002843.png


And again thanks in advance for your time and help!
Hello again, I ran into another problem while doing the same custom cost: the tp.

so another requirement to this skill is that both actors 1 and 2 have at least 100 tp
and in cost perform it would take the 100 tp from both actors.

Am I using JavaScript again or is it something else this time?
notetag on the skill:
View attachment 216213
And the error in the console:

View attachment 216214

And again thanks in advance for your time and help!
With multiple conditions you need to join them together with a logical operation, either && (AND) or || (OR). In this case, you'd use && since you need all three conditions to be true.
It works now, that was a pretty easy fix.

Thanks for the quick reponse
Then the thread is solved, I achieved what I wanted with this event.

Thank you all again for your time and help. Have a wonderful day!

I've moved this thread to Script Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/custom-skill-cost-problem.144889/