Looking for some scripting help

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
Hey folks,

I've run into an issue where I need to be able to reference a few things that I can't find ways to do with the base program. What I would like to be able to do is check which actor is using a specific item. In other words, a way to be able to check which actor is having an item used on them to check for compatibility with said item. I can't find a way to check this, and I've tried a combo of different ways to try and make a workaround, but it just isn't possible with what I've tried thus far.

I would also like a way to check if specific actors have ability types rather than just specific abilities. For instance, I only want my mage capable of using fire to be able to learn fire, not my healer who cannot use fire magic, or my warrior for instance.

I wanted to tie together a common event that can check who is having x item used on them, and whether they are capable of learning it or not. I have it all put together, but I'm just missing a thing or two to make it work as intended. Is this possible? I suspect there is a simple script call that one could use, however I am ruby illiterate.

If you need more info, just let me know. I'm kind of hastily typing this down before I leave for an appointment I have. Your assistance is much appreciated.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,787
Reaction score
7,876
First Language
German
Primarily Uses
RMMV
easy.

create an invisible state without any messages, and have the item apply it to the user in addition to starting the common event.

then in the common event you check which actor has that state applied, process the commands you want for that actor and then remove the invisible state for the next use of the item, whenever that might be.
 

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
Cool idea, but will it be able to detect the things I need to detect, such as whether the actor is capable of the correct magic school or not?

Edit: I figured out a way to make it work using the state as a condition, thanks for the suggestion!
 
Last edited:

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
Just wanted to make it clear that I am still looking for a script call for detecting when a certain skill is being used, and by whom.

I need something that detects that x skill is being used, and when used, it needs to determine who was using it no matter where they are in the party. I haven't found a way to do this, and it's necessary for some of the mechanics I intend to implement.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,605
Reaction score
14,329
First Language
English
Primarily Uses
RMVXA

I've moved this thread to Learning RGSSx. Please be sure to post your threads in the correct forum next time. Thank you.

 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,605
Reaction score
14,329
First Language
English
Primarily Uses
RMVXA
Don't worry about it, Ace uses RGSSx for coding so I put you in the coding forum. Might make it easier to get help on this. Note that MV/MZ use javascript if you ever change to them.
 

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
Sweet, much appreciated.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,787
Reaction score
7,876
First Language
German
Primarily Uses
RMMV
I haven't found a way to do this,
that is because you're coming at it from the wrong side.
computers doesn't work that way.

you need to have the skill signalling when it is working, and then you can check the data when it is signalled. The code for signaling needs to be added to the skill, and until that happens there is no way to detect the skill use at all.

How that is done depends on what data you need when. if only one or two skills need to trigger the other effects, you can add code to the damage formula.
If this is a more complex situation the better way would be to have a script rewrite the skill process by introducing new storage variables that would contain the data for the last skill used, last target selected and so on (something that had been added to MZ but didn't exist in VXA).

I think Tsukihime wrote a script that partially added that functionality to VXA, but it's beed too long since I last checked on Ace scripts. And you would have to be much more specific on what data you want to have stored where before someone could write a script like this for you.
 

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
Thanks Andar, I'll try to be specific with what I'm trying to accomplish.

you need to have the skill signalling when it is working
I have this part figured out, the issue is being able to tell who is using the skill. Using the skill calls up a common event that handles all of the detailed work that I want to happen, but I have no way of having the common event tell who is using the skill. There is a way to use variables to detect which party member slot is what actor that I've found (party member #1 is actor #34, for instance, therefor the variable can be changed to represent this by changing to 34), but that doesn't work with detecting which party member was the one who triggered the common event by using the skill. I can either just make it check which actor is on which specific party slot, or I can make it check all of the party slots, but I haven't found a way to make that work for detecting who used the skill in the first place.

I've thought of using states to make temporary flags to detect when a skill is being used by whom, but if I go with that route, I will have to have a separate common event for every skill in the game, for every actor who can use the skill, and that will take up around 200 variables and switches for the single target abilities alone, which I am trying to avoid. If there is a simple chunk of script that I can use to detect which actor is using which skill, it will enable me to shorten that enormous bloat down to a single common event, and greatly reduce the amount of variables and switches needed since I won't have to manually put in work arounds for detecting every little phase of the system that needs to be detected to make the system work. I hope that all makes sense.

I imagine there could be a way to detect which actor used what skill since there is handling already in the program that handles actor ID's, as well as skills, states, and that sort of thing. There is also a "last target" prompt that I found, which leads me to believe that it is possible to detect "last user", so to speak. So if I can find a way to make a script detect [actor] using [skill], then it should be possible to handle those variables as number variables since the program can already do that, just not in the way I need it to. I can make skills turn on switches via common events, or I can turn states into pseudo-flags, which are both detectable by the event system, but using that method will be very costly on variables and switches, as I mentioned before.

So, if I can get something that does something like this:
If [actor] is [skill used] >
>
Else >
>
Branch End
then all of my problems will be solved. It can even be something like:
If [skill used] >
If [actor] >
>
Else >
>
Branch End
>
Else >
>
Branch End
The Else cases aren't necessary, I just put them in to sort of show in more detail what event handling would look like with those prompts possible. It's the If [actor] that I really need more than anything. I can easily make the skills detectable by a couple of different means. I need a way to detect when an actor uses a skill, no matter where they are in the party, and no matter who they are, just so long as it can tell who is using the skill. That would grant me complete freedom to really go hard with the system that I am envisioning.

Thanks for taking the time to read through this. I hope this explains what I'm looking for properly.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,787
Reaction score
7,876
First Language
German
Primarily Uses
RMMV
If there is a simple chunk of script that I can use to detect which actor is using which skill,
that doesn't exist by default, but I think I remember tsukihime writing one script that has something like this as a subfunction. unfortunately I don't remember which one it was.
But tsukihime was big on utility scripts, so you might check what is out there

no matter what, with your description you will need such a script, it can't be handled effectively with a common event and default data (as you said you would have to account for too many branches and lists)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,818
Reaction score
622
First Language
English
Primarily Uses
RMVXA
I know of a script called
# Get Battle Info [VXA]
# Author: Mesiah A.K.A. Mako Infused
that has script calls.

I use one for

# CALL: battle_info_user.id
# HELP: This would retrieve the id of the current battler whose executing an
# action in battle.

also there is

# CALL: battle_info_used.id
# HELP: This would retrieve the id of the current action that has been executed
# in battle.

I put the values into variables and then you can do check against the variables, do actions with the variables, etc
$game_variables[133] = battle_info_user.id

But it does not check if it was an item or skill. so partially there on that, but you can just do a scheck against your skills. As long as it will always be a skill or always be an item.
 

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
Thanks a bunch you guys, I'll give these a look and I'll get back to you in a bit with whether I was successful or not.
 

Testtubebaby

Wizard of the woods
Veteran
Joined
Oct 31, 2020
Messages
45
Reaction score
23
First Language
English
Primarily Uses
RMVXA
So far, the verdict is that none of the scripts that I could find have solved my problem, so I may have to settle for doing things the long and hard way. I have found plenty of neat ones that I plan on testing out though.

Roninator2, do you have a link to that script? I haven't been able to find it.

I've been looking in the system scripts, and I have seen several different calls that refer to things reminiscent of what I'm looking for, but I have no idea how to write a script to utilize them. I may have to put in some extra time to learn script writing so I can figure out how to tell the program to do what I want it to do. Either that or I can stop being so stubborn and specific with how I want things lol

As I was thinking about it, one way to make it work would be to have an ability affect more than a single target. For instance, having a skill that applies effects on both the user and the target. I saw something like this in the list of scripts by tsukihime that Andar linked, but it didn't work in my game unfortunately. And there is no way to properly make a skill execute another skill at the same time (or in succession) that I've found without having to use events to manually process data in a roundabout way.

So at the moment, I am going to continue to work on making my system the long way. I'm just happy I can get it to work honestly, but it would be very helpful to free up all the events, variables, skills etc. that I require to make it work. If we can figure out a way to make it work more efficiently, I will remake the system using that method.

I really appreciate the help you guys, I hope we can figure this one out.
 

Latest Threads

Latest Posts

Latest Profile Posts

Making Houses and Outside on the same map with RPG Maker MV!
Do people actually use buff/debuff function?
Ami


Imagine you (as Miner) Sleep in the Cave,the other side is a Bunch of Golds,how d'you feel?
finally got footage of my main character running around his corrupted street...
I finally got the ships and water to flow like I wanted to~ the canals are a success. Now to loop the animation for the kites. So many kites.

Forum statistics

Threads
107,702
Messages
1,031,532
Members
139,835
Latest member
dangkykubetim
Top