Saving the name of the target/user of an ability as a variable

JohnNewton

Warper
Member
Joined
Jun 13, 2015
Messages
2
Reaction score
0
Primarily Uses
After some basic searching, I haven't found any way to do this, so I figured I'd ask.

Is there a way to save the names of the target and/or caster as a variable? For example, if Bob uses ExampleStab to attack Thug, you could set ExampleStab up to save the casters name as variable 5 and the targets as variable 13. Ideally, the variables used would be configurable on a per-ability basis.

Is there (for example) some damage formula script command that I've missed that does this?

Also, not that I have any use for it currently, but what about a way to save the ID (list number) of the caster/target in a similar fashion? Saving "castername" to v5 and "casterID" to v7, for example. Might run into problems because player characters could have the same ID number as monsters (both Bob the Hero and Generic Thug might be number 3 on their respective lists), but I thought I'd ask anyway, just in case I end up finding some use for the ID in addition to the name.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
There are two advanced common event scripts (one from Tsukihime and one from SES if I remember correctly) that save skill data into variables to enable a common event called by the script to access that data, including user ID and target ID/index.


Sorry, I don't have the links ready but that information should be enough for you to search them on the master script list.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
You could try adding $game_variables[5] = b.name; (or b.id;) at the beginning of the damage formula and see whether that works - I don't use the shortcut v[5] for this purpose, though (and for tracking the caster's name/id, use a.name instead).

I believe Shaz has a script to carry forward some information about the target (and maybe the caster too?), so if that script works for you, you can save a lot of effort and room in the formula box by using it instead.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
If I remember correctly, some ID's don't work in the damage formula - but I don't know exactly if that were actor ID or enemy ID or whatever.


That's why I suggested the scripts that automate this function.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I used to do that before, and I'm sure it worked for me.
 

JohnNewton

Warper
Member
Joined
Jun 13, 2015
Messages
2
Reaction score
0
Primarily Uses
Using the damage formula for names seems to work perfectly. ID's, not so much, but I don't really need those anyway. I'll try the scripts if I ever find myself in a situation where I do. Unfortunately, common events attached to skills don't seem to fire if the skill kills the target, but that's a minor issue.

Also: Is there a way to disable a skills casting message entirely? I have some skill text that I handle through common events now, but even if I remove all the skill use text, the casters name still shows up in combat.

"Steve"

"The enemy takes 22 damage."

To be clear, I'm fine with the damage part. I just want to get rid of the name (and the row it appears on, I suppose. Don't want a blank row either.).
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Also: Is there a way to disable a skills casting message entirely? I have some skill text that I handle through common events now, but even if I remove all the skill use text, the casters name still shows up in combat.
"Steve"

"The enemy takes 22 damage."
There are ways to disable the casting message for all skills, but for certain skills only, that's harder to do.

I've got an incomplete script that allows much greater control over how battle log text is worded (e.g. "Bob infuses some of his health into Alice!"), and it will also be able to display nothing at all (even the user's name).  But I looked into the script just now and the functionality for not displaying anything isn't in there yet.  So just keep an eye out; I'm going to release that script once I've got the more important work off my plate (hopefully in a couple months).
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
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

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top