Jump to content


Photo

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


  • Please log in to reply
1519 replies to this topic

#1501 Xypher

Xypher

    Advanced Member

  • Ace Member
  • 886 posts
  • RM Skill - Jack of All Trades

Posted 21 August 2014 - 04:55 AM

i meant using the damage formula box in the skills tab in the database.

 

you could add it to the end of item_apply like this

  def item_apply(user, item)
    @result.clear
    @result.used = item_test(user, item)
    @result.missed = (@result.used && rand >= item_hit(user, item))
    @result.evaded = (!@result.missed && rand < item_eva(user, item))
    if @result.hit?
      unless item.damage.none?
        @result.critical = (rand < item_cri(user, item))
        make_damage_value(user, item)
        execute_damage(user)
      end
      item.effects.each {|effect| item_effect_apply(user, item, effect) }
      item_user_effect(user, item)
      $game_system.one_soul_guard_break_bonus += 1 if actor? && guard? && user == self
    end
  end


#1502 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,285 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 21 August 2014 - 11:56 AM

Thanks, that clearly worked :)


2118bus.jpg
 
If you want to use or know all of my scripts, please click the small banner below:
 
script_banner.jpg?w=200&h=200
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler
 
And a bit of the name I use when making my games:
 
Spoiler

 


#1503 Mr. Trivel

Mr. Trivel

    Planning revenge

  • + Premium Members
  • 338 posts
  • LocationThe Internet
  • RM Skill - Coder

Posted 21 August 2014 - 12:44 PM

@Xypher, SoulPour777,

You can also alias it for more compatibility

alias :guard_var_item_apply :item_apply
def item_apply(user, item)
  guard_var_item_apply(user, item)
  if @result.hit?
    $game_system.one_soul_guard_break_bonus += 1 if actor? && guard? && user == self
  end
end

trivelsig2.png

 

 

Spoiler

 

Stuff:

Spoiler

#1504 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,285 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 21 August 2014 - 12:46 PM

 

@Xypher, SoulPour777,

You can also alias it for more compatibility

alias :guard_var_item_apply :item_apply
def item_apply(user, item)
  guard_var_item_apply(user, item)
  if @result.hit?
    $game_system.one_soul_guard_break_bonus += 1 if actor? && guard? && user == self
  end
end

 

I did ^^ It works perfectly on my system. That was really one of the things I missed :) Thanks for the help. :D


2118bus.jpg
 
If you want to use or know all of my scripts, please click the small banner below:
 
script_banner.jpg?w=200&h=200
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler
 
And a bit of the name I use when making my games:
 
Spoiler

 


#1505 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 267 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted 22 August 2014 - 01:15 PM

I am using a script that has customizable content. Thing is, I want the content to be different based on a switch. Basic options if switch is off and the good stuff if the switch is on... Was thinking something like

 

if switch[1] is true then

        this stuff

else

        that stuff

end

 

(obviously pseudo code, b ut you get the drift)

 

Any thoughts?


My girlfriend is trying her hand on getting educated...

GoFundMe


#1506 Quasi

Quasi

    Advanced Member

  • Ace Member
  • 117 posts
  • RM Skill - Jack of All Trades

Posted 22 August 2014 - 02:41 PM

I am using a script that has customizable content. Thing is, I want the content to be different based on a switch. Basic options if switch is off and the good stuff if the switch is on... Was thinking something like

What you can do is, in the refresh method do something like:

def refresh
 contents.clear
 if $game_switches[1] == true
   draw_content_one
 else
   draw_content_two
 end
end

then make the defs, draw_content_one and draw_content_two.
then all you have to do, is a refresh whenever the switch changed.


quasi-1.jpg


#1507 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 267 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted 22 August 2014 - 03:39 PM

Hmm, that was borderline gibberish to me, lol. Its a Formation script and I am looking to have combat (side view) formations be different depending on the switch.

Spoiler

I want that but also different values depending on the switch. What it sounds like is that it only reads this once and done, regardless of switch? I thought it would check each combat...hmm


My girlfriend is trying her hand on getting educated...

GoFundMe


#1508 Quasi

Quasi

    Advanced Member

  • Ace Member
  • 117 posts
  • RM Skill - Jack of All Trades

Posted 23 August 2014 - 01:20 PM

That's cause it's a constant, and well it's not suppose to be changed.  There are ways around it though, here's one way:

Spoiler

There was another way I used to do before but I can't remember how to do it.  But I tested this out and worked fine.  So you just have to find out where/when you want to run View::change, now. or rename that method if you would like.


quasi-1.jpg


#1509 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 267 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted 23 August 2014 - 03:54 PM

The...method, thats View? I want to keep it as close to the original so there is no compatibility issues. Also, I have it so that when combat starts, it runs the very first troop, which is how I add states to the players based on position (front vs back).

 

Now, how does one...um....make it work?

 

EDIT: I see what I did wrong, gonna give it another try...

 

Ok, no more errors BUT how do I call it so that the formation actually changes?


Edited by SirCumferance, 23 August 2014 - 04:10 PM.

My girlfriend is trying her hand on getting educated...

GoFundMe


#1510 Quasi

Quasi

    Advanced Member

  • Ace Member
  • 117 posts
  • RM Skill - Jack of All Trades

Posted 23 August 2014 - 07:05 PM

Depends on what battle system you are using.  For the default one, you'd probably paste the code inside of def start or def post_start, that way the constant values change before they are read.  They are probably read in during the create_spriteset method.  But again, depends on what battle system you are using.


quasi-1.jpg


#1511 caelumania

caelumania

    Incident Resolution Specialist?

  • Ace Member
  • 36 posts
  • LocationThe shoulders of giants
  • RM Skill - Jack of All Trades

Posted 24 August 2014 - 09:10 AM

Hey guys, so I ran into some trouble while trying to give my battle windows a background image. What's happening is that the bg image shows up even before the windows are visible. I'm taking about the time the message window says "This guy has emerged", the image is there with the enemy sprite. I also tried skipping the message window but the bg image would appear first (from 0, 0) then move to where its window is when the windows become visible. I looked up moghunter's script for a lead on how to fix it (after trying out fadeins and waits) but it seems like he forces his windows to close or something (not sure though), which I don't have the faintest idea how to do (not to mention "forced" stuff sounds possibly troublesome) Any ideas on how I can deal with this? I used a method I saw in one of Gubid's tutorials to show the bg by the way.



#1512 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,285 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 24 August 2014 - 02:00 PM

Hey guys, so I ran into some trouble while trying to give my battle windows a background image. What's happening is that the bg image shows up even before the windows are visible. I'm taking about the time the message window says "This guy has emerged", the image is there with the enemy sprite. I also tried skipping the message window but the bg image would appear first (from 0, 0) then move to where its window is when the windows become visible. I looked up moghunter's script for a lead on how to fix it (after trying out fadeins and waits) but it seems like he forces his windows to close or something (not sure though), which I don't have the faintest idea how to do (not to mention "forced" stuff sounds possibly troublesome) Any ideas on how I can deal with this? I used a method I saw in one of Gubid's tutorials to show the bg by the way.

 

Are you calling it on the viewport same as where the battlers are made?

 

If you're calling it via Scene_Battle, you should be able to override that by calling the BG in before battle_start method. Or if not, try to do it via the Spriteset_Battle class.


2118bus.jpg
 
If you want to use or know all of my scripts, please click the small banner below:
 
script_banner.jpg?w=200&h=200
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler
 
And a bit of the name I use when making my games:
 
Spoiler

 


#1513 caelumania

caelumania

    Incident Resolution Specialist?

  • Ace Member
  • 36 posts
  • LocationThe shoulders of giants
  • RM Skill - Jack of All Trades

Posted 24 August 2014 - 09:37 PM

I'm not sure if it's on the same viewport but the bg is supposed to have @status_window's viewport. And its called during the method that creates @status_window, I think that one is part of create_all_windows(?) and is called in initialize so I'm guessing it is before battle start. I am not really familiar with the Spriteset_Battle class, I think I'd give it a look today. So I somehow managed to make the bg not show by making its opacity equal to its window's openness and have it appear by doing the same on its update method but I find it weird since I had its visibility set to false (though it was showing) so it looks kind of redundant (to me at least). Maybe I should also look into what visible exactly means in rpg maker. Anyway, thanks for the tips, I think I'd really take a look at Sprieset_Battle so I could take another step closer to a nice battle hud.



#1514 SoulPour777

SoulPour777

    Crownless King

  • Ace Member
  • 1,285 posts
  • LocationPhilippines
  • RM Skill - Coder

Posted 24 August 2014 - 10:28 PM

@status_window's viewport is the @info_viewport, which basically it shows right with the battle status, since they are of the same viewport. You should make a new window that isn't the same viewport with the status_window. This was also my problem on my One Soul Battle System before, turns out it was the info_viewport. Anyways, the visibility is called by hide and show in the Window_Base. I suggest creating a new window that adheres to the battle hud, instead of doing it on the same way as the status. That way you can position it anywhere and set up its visibility.

 

Usually, you might want to fork it in Scene_Battle or Spriteset_Battle. But I'd go definitely with Scene_Battle.


2118bus.jpg
 
If you want to use or know all of my scripts, please click the small banner below:
 
script_banner.jpg?w=200&h=200
 
My Games:
 
slender-8-torches1.jpg attack-on-trees.png?w=625
 
I support the following projects and people:
 
Spoiler
 
And a bit of the name I use when making my games:
 
Spoiler

 


#1515 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 267 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted 26 August 2014 - 03:47 PM

@Quasi, just realized you are on it with helping me out, many thanks. I am using Symphony just for the sideways and would get rid of it if I had a sideways system that allowed Formation placement like in Symphony, but most just 'Last guy.y +=20' kind of thing.

 

How should I get that to work in Symphony


My girlfriend is trying her hand on getting educated...

GoFundMe


#1516 trapless

trapless

    ɘltiT ЯɘdmɘM

  • Ace Member
  • 69 posts
  • RM Skill - Jack of All Trades

Posted 31 August 2014 - 05:43 PM

I'm having a strange issue with sound.

  Firstly, I'm building a custom menu. I created sounds for [cursor_move], [cursor_select] and [cursor_cancel].

I removed all default sound at the beginning of my project and cleared them from Database because they are crap(imo) and i dont want them to play how the scripts tell them too.  I added my new sounds to module Sound like so:

Spoiler

 

so... the issue is:

  When i'm in menu and moving the cursor, [cursor_move] plays as it says to in module Sound.

I then make [cursor_select] play and it plays fine too... When I play [move_cursor] again the volume is almost mute.

Each time the [cursor_move] sound play consecutively the volume increases slightly until its %100 even tho its set to play at %80.

Playing another sound will return it to near mute.

wtf !eb   I cant view module Audio to figure out why.

 

Here is a video so you may see and hear:

 

can anyone offer any info to resolve this strange thing?


Edited by trapless, 31 August 2014 - 05:47 PM.

galv-plea_zps59cc531b.png


#1517 Quasi

Quasi

    Advanced Member

  • Ace Member
  • 117 posts
  • RM Skill - Jack of All Trades

Posted 01 September 2014 - 12:35 AM

@SirCirumferance

I'm not sure, I've never looked at any custom battle scripts before besides GTBS.

 

@trapless

I was playing audio like that for like 10mins until I noticed my lil master volume snippet didn't work for it ( I like to lower all my games sounds to nearly mute when testing scripts. )  So I just changed how I played the audio.

like so:

wrong = RPG::SE.new("Buzzer1")
wrong.play

then you can add .pitch and .volume to change those settings.

Not sure if that will fix it for you but won't hurt to try, since that's how the default sounds play, I think.


Edited by Quasi, 01 September 2014 - 12:38 AM.

quasi-1.jpg


#1518 trapless

trapless

    ɘltiT ЯɘdmɘM

  • Ace Member
  • 69 posts
  • RM Skill - Jack of All Trades

Posted 01 September 2014 - 11:53 AM

@quasi

 

does the same when:

    if @index != last_index
      move = RPG::SE.new("Cursor/move")
      move.volume = 80
      move.play
    end

I figured that would work. It should reset the volume every time its played because its a local variable.... but no.


Edited by trapless, 01 September 2014 - 11:56 AM.

galv-plea_zps59cc531b.png


#1519 Quasi

Quasi

    Advanced Member

  • Ace Member
  • 117 posts
  • RM Skill - Jack of All Trades

Posted 01 September 2014 - 12:17 PM

Oh you can also initialize it as: just so you don't need the extra line.  I forgot about this last night lol

move = RPG:SE.new(name, volume, pitch)

Mm for the cursor move, how the volume increases, kind of sounds like the volume is stacking.  Maybe putting a stop before the next one plays might do it

move.stop 

^ that probably wouldn't even work since it hasn't been made yet, would have to be instance variable.

or

Audio.se_stop 

Which stops all SE I think, never tried it but that's what it says.


quasi-1.jpg


#1520 SirCumferance

SirCumferance

    Advanced Member

  • Ace Member
  • 267 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted 02 September 2014 - 02:03 PM

@Quasi

My girlfriend is trying her hand on getting educated...

GoFundMe





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users