Check Skill/Item Scope [Solved]

Status
Not open for further replies.

SwordSkill

Villager
Member
Joined
Jul 16, 2013
Messages
10
Reaction score
2
First Language
Greek
Primarily Uses
Ok, I really hate it when I can't do something on my own but this one seems much more complicated than I imagined it..


Anyway, what I want is a way to check a Skill or Item's scope to use it in damage formula.


Here's the deal: Although Tsukihime's "Action Target" is working perfectly, I assumed that the same targeting system will apply even outside the battle.


So by using Yanfly's Lunatic Damage I managed to create a damage formula that divides the damage among the targets (With the help of Tsukihime's Action Targets Script):


value /= a.current_action.targets.size;


It worked perfect in battle. The next day I tested the game to check if everything was working correctly and I wanted to heal my Party member before entering the dungeon. So I when to the Cure skill, and changed it's scope from the Tsukihime's Scope Change script.


Then I pressed Z to heal and boom! An error. Apparently the game handles differently the in battle and out of battle objects.


Annyway after some searching, I found a usefull condition to check if I'm in battle or out of battle. So I put it in the damage formula.


if $game_party.in_battle;


  value /= a.current_action.targets.size;


end;


As expected then the division works only while in battle leaving the Cure's Heal unaffected while using it out of battle (From the menu.)


So there is no point, not using it on all Party members if you have more than one. Not only it heals all party members the same amount as it would heal a single party member but it also consumes the MP once, meaning that the game is actually rewarding the player for Healing all party members at once rather than healing one party members, which makes the Skill useless if being used from the Menu on only one Party member, the only time the player would need to heal one party member (that is in a party with more that one member.) with a skill from the menu,


is when before he learns that he can heal them all at once.


 So I went ahead a little further and tried to fix this as well so that the healing will be divided among the party members when used on more than one:


when /Distribute Damage/i


if $game_party.in_battle;


  value /= a.current_action.targets.size;


else;


  if $scene_itembase.item.for_all;


     value /= $game_party.members.size;


  end;


end;


But unfortunatelly the " if $scene_itembase.item.for_all;" part isn't working... I spend countless hours trying to find these words


I assumed that a Class's name can be referenced in ruby as a global variable like $game_party class for example, that's how I came up with $scene_itembase (Even though I never saw any "This class can be referenced as '$scene_itembase' on top of the description of the class.")


Anyway, that thing has happened to me really often and generally the fact that I can't find any way to reference something from one script to another.


I admit I'm not a good scripter but I want to believe that at least I know the basics.


However when comming to reference things from one point to another, that's nearly imposible for me unless we talk about straightforward things.


Anyway, long story short, I need to find a way to reference the scope of the skill that being used from the menu to change the


'if $scene_itembase.item.for_all;' part into that.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
value /= a.current_action.targets.size;This doesn't work outside of battle because there are no "actions" outside of battle.
I assumed that a Class's name can be referenced in ruby as a global variable like $game_party class for example
No.

Try

Code:
SceneManager.scene.item
 
Last edited by a moderator:

SwordSkill

Villager
Member
Joined
Jul 16, 2013
Messages
10
Reaction score
2
First Language
Greek
Primarily Uses
I'm really sorry, to tell the truth I'm really lost now, am I supposed to use 'SceneManager.scene.item' or is a map to find the referencing? I'm terribly sorry I'm sensing you are saying something simple but I'm really stupid to understand.

 

I did some attempting failures with what you gave me, at first I thought it was a referencing map, but it it was shouldn't be '::' instead of '.' after 'Scenemanager' but before 'scene' part? I'm pretty sure to advance from a module to a class someone has to type '::' right?

 

Anyway, what I'm actually looking, is a way to reference if the skill that is going to be used targets a single or all allies in menu to use it in Lunatic Damage as a condition that modifies the damage overall.

Briefly speaking

 

if $game_party.in_battle; #(When the party is in battle)

 value /= a.current_action.targets.size; #(The damage will be divided for each target.)

else #(If the party is NOT in battle.)

 if [the skill's target is targeting everyone] #(This is the part that's been troubling me. I don't know how to translate this part in scripting language.)

   value /= $game_party.members.size; #(The damage will be divided for each Party member.)

 end;

end;
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
SceneManager.scene returns the current scene. I don't know what kind of scripts you are using that allows you to use skills on the map, but the default scripts require you to use your skills in the skill scene.


So if you're outside of battle and you want to know which skill was selected then you would access item from the current scene (assuming it is the skill scene)
 
Last edited by a moderator:

SwordSkill

Villager
Member
Joined
Jul 16, 2013
Messages
10
Reaction score
2
First Language
Greek
Primarily Uses
SceneManager.scene returns the current scene.
So if I understood correctly, if there were a script call to be made while on skill scene like this 'SceneManager.scene' it would return the Skill scene correct? And if I also add the method inside it (SceneManager.scene.item) it would return the selectable item? Aka the Skill?

I don't know what kind of scripts you are using that allows you to use skills on the map, but the default scripts require you to use your skills in the skill scene.
Yeah don't worry, I'm using the build in scripts, that means as you said, I have to go inside the Skill scene if I want to cast Cure.

So if you're outside of battle and you want to know which skill was selected then you would access item from the current scene (assuming it is the skill scene)
Yeah if my first statement was correct then I should access the skill in the current scene by using 'SceneManager.scene.item' right?


However my point is, how do I return if that skill is targeting one or everyone? I tried using 'SceneManager.scene.item.for_all' in hopes that it would return 'True' if the Skill was targeting everyone but it didn't seem to work, actually it thrown me an Error (I think it couldn't find the method 'for_all' in that skill.)


Leading me to the most important question: What is the method that checks if the is selecting one or all party members? I tried checking in inside 'Scene_ItemBase' and the closest thing I managed to find was 'item_target_actors' method.


it really picked up my attention since the description says that it makes an array that contains the target, so if I could return that array and was able to...


Okay, I finally got it to work, thanks again so much Tsuki-chan, I'm really stupid, but seriously thanks, that would add a lot of depth in the game.


I won't hide you that when I started with all this change scope and target thing, at first I picked up Victor's scripts but not only it seems to incompatible with custom battle systems (since it messes around with a lot of things that I didn't like.) it requires you to have the basic module which does things even worse, anyway sorry for the ranting but seriously thanks for replying, and on top of that it seems that I'm able to use this thing even for items.


By the way just for the record you know where I got stuck? I got stuck for a freaking '?' at the end of the for_all. If you noticed above i typed above 'if $scene_itembase.item.for_all;' instead of 'if $scene_itembase.item.for_all?;'


Haha, this is one of the rare benefits of eventing, but aside from that in really binds your hands :) .


Anyway thanks again Tsukihime Princess of the Moon. Yeah anyway, you can lock this now, solved.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

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
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top