Jump to content


Photo

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


  • Please log in to reply
1506 replies to this topic

#1501 Xypher

Xypher

    Advanced Member

  • Ace Member
  • 869 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,148 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
 
 

 


#1503 Mr. Trivel

Mr. Trivel

    World is my playground

  • + Premium Members
  • 272 posts
  • 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,148 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
 
 

 


#1505 SirCumferance

SirCumferance

    Advanced Member

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

Posted Yesterday, 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
  • 99 posts
  • RM Skill - Jack of All Trades

Posted Yesterday, 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
  • 254 posts
  • LocationPortland, Oregon
  • RM Skill - Jack of All Trades

Posted Yesterday, 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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users