Ruby/RGSSx questions that don't deserve their own thread

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Hello, I have a small doubt, I installed Victor animated battle and Victor Damage pop up script, in tandem with MOG Battle HUD, for some reason, the damage is showed of this way



As you can see, the damage is showed in the upper left part, which it's not right, and considering both are made by the same scripter, it must be a simple solution, also, this is the script order I have, just in case is something related to the script order



How can I solve this? thanks
Ehhh please, could someone help me with this thing? n_n
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Please start a NEW thread. You are asking for help making three different scripts compatible. That is NOT a question that doesn't deserve its own thread. When you start your new thread (in RGSSx Script Support), include links to the scripts so people don't have to go searching for them. And allow people more than 5 hours to respond before you bump your question. Our forum rules can be accessed from the lower right corner of every page.
 

A_Random_Person

Villager
Member
Joined
Jun 24, 2014
Messages
5
Reaction score
0
Primarily Uses
In a script, how I do check the current actor? As in the actor currently selected and can do actions (attack, use skills, etc).
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
how do I check the weapon type of the equipped weapon (if it is an axe, a sword, a spear...)?
 

Mihel

Veteran
Veteran
Joined
Mar 13, 2012
Messages
382
Reaction score
42
Primarily Uses
@Waterguy $data_weapons[x].wtype_id == y
 

Duban65

Villager
Member
Joined
Jun 18, 2014
Messages
9
Reaction score
0
First Language
German
Primarily Uses
Hey Guys,

i tried to draw the the character graphic in the menu using this snippet

if $game_variables[4] = 1 character_name = "$GiantRat_Pose" character_index = 2 end draw_character(character_name, character_index, 100, 100) def draw_character(character_name, character_index, x, y) return unless character_name bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign && sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) contents.blt(x - cw / 2, y - ch, bitmap, src_rect) endbut the character sprite is not show in the menu. They is no failure or something, game is working well

i tried to change the x y and z value but nothing happend.

Maybe someone of you know were is my failure.

Thanks
 

Mihel

Veteran
Veteran
Joined
Mar 13, 2012
Messages
382
Reaction score
42
Primarily Uses
@Duban65 you didn't specify in which class you've put those methods in. Is it Window_MenuStatus?
Are you sure it doesn't give you any errors? If I put if $game_variables[x] outside of a method, the game just crashes... Also, it should be if $game_variables[4] == 1, with two = thinghies.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
= means "assign this value to this variable"


== means "does this variable have this value in it"


Still, I don't think that would cause this issue - it simply means that condition would always be true and that sprite would always be used.


You're also not using character_index in the same way as the default scripts. I see what you're trying to do, but it's too early in the morning for me to go through the logic of your src_rect calculation to see if there's an error there.


You could put in some p commands to print stuff to the console, then play with the console turned on. That should help you determine where the code is doing something that deviates from what you THINK it is doing.
 

A_Random_Person

Villager
Member
Joined
Jun 24, 2014
Messages
5
Reaction score
0
Primarily Uses
You can try using different x and y values, if you're using a window and it's out of bounds for the dimensions of the window it won't show up.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
True - if that's the case, you should be able to change 100, 100 to 0, 0 and be able to see the lower right quarter of the image. That would tell you that the problem is the x and y values you're passing in.


Or just pass in 0 and 0 and not adjust them by cw/2 and ch when you draw.
 

Synapsiz

Villager
Member
Joined
Jun 16, 2014
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
A quick question about the damage formula box.

I'm calling a custom script from the damage formula box and i want to pass the notes on the skill used to that formula.

Do I use "MyDmgFormula(a, b, self.note)" or do I have to use a different syntax?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
I think that, if you set the parameters right, this should work.

remember that you have to do an RPG::BaseeItem or RPG::UsableItem method to be able to call this note.
 
Last edited by a moderator:

Synapsiz

Villager
Member
Joined
Jun 16, 2014
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
Could you elaborate on that?

I have tried various different combinations of writing note, RPG::BaseItem::note etc.

most just result in "no damage"

using @note gives damage, but the game seems to ignore the notes.

more info:

in skill damage formula: 

MyDmgFormula(a, b, @note)

in skill notes:

<mult 5>

in script:

class Game_Battler < Game_BattlerBase

 def MyDmgFormula(a, b, notes = '')

 mult = 1.0

 if notes =~ /<mult (.*)>/i

   mult = $1.to_i

 end

 

return 10 * mult

 

end
edit: fixed a mistake
 
Last edited by a moderator:

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
pretty sure it is self.note that you need instead of @note. also your notes variable is equal to " instead of ""

ignore my previous post, I had learned to read notes from reading Yanfly scripts, but I read one from Mr.Trivel that is pretty close to yours.
 

Synapsiz

Villager
Member
Joined
Jun 16, 2014
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
Ok, I've solved the issue

Even though the code string is part of BaseItem through inheritance, the place where the code is actually executed probably isn't.

I guess that's why @note and self.note didn't work.

What did work was to pass the skill ID and load the notes from that skill in the script itself.:

class Game_Battler < Game_BattlerBase

 def MyDmgFormula(a, b, SkillID = 0)

if SkillID != 0

  notes = $data_skills[skillID].note

 mult = 1.0

 if notes =~ /<mult (.*)>/i

   mult = $1.to_i

 end

 

return 10 * mult

 

end
Thanks for taking the time to help
 
Last edited by a moderator:

Duban65

Villager
Member
Joined
Jun 18, 2014
Messages
9
Reaction score
0
First Language
German
Primarily Uses
Sry my fault.

The class is Window_Base and put the x and y value to 0 doesnot have any affect.

Changed the if $game_variables[4] = 1 to if $game_variables[4] == 1 and no

error acurred.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,517
Reaction score
3,221
First Language
Binary
Primarily Uses
RMMZ
Edit:

@Duban65 -  I feel that your question warrants its own thread, so yea...

Anyway...

If I alias a method in a 'child class' where the method is only defined in the 'parent class', would this have any negative consequences ?

Would I be better to simply call 'super' rather than call the aliased method?

Actually... Now that I think about it, having an extra aliased method floating around cant be a good thing... I will just stick with super on this occasion.

While I am asking though, are there any other 'more deadly' negative impacts of aliasing a method as previously described?
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,456
Members
137,821
Latest member
Capterson
Top