RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
DT's Experience on hit

0 Members and 2 Guests are viewing this topic.

****
Rep:
Level 71
DT's Experience on hit
Version: 1.0.0
Author: DoctorTodd
Date: 4/27/2012

Version History


  • Version 1.0.0  2012/26/22 - Original Release

Planned Future Versions

  • None planned, you tell me.

Description


Gives the player experience when he/she hits the enemy rather than at the end regardless of hits.

Features

  • Plug and play

Screenshots




Instructions

Paste above main.

Script


Code: [Select]
#===============================================================================
#
# DT's Experience on hit
# Author: DoctorTodd
# Date (04/27/2012)
# Version: (1.0.0) (VXA)
# Level: (Simple)
# Email: Todd@beacongames.com
#
#===============================================================================
#
# NOTES: 1)This script will only work with ace.
#
#===============================================================================
#
# Description: Gives the player experience when he/she hits the enemy rather
# than at the end regardless of hits.
#
# Credits: Me (DoctorTodd)
#
#===============================================================================
#
# Instructions
# Paste above main.
#
#===============================================================================
#
# Contact me for commercial use, other wise just credit me and don't repost
# without my permission.
#
#===============================================================================
#
# Editing begins 38 and ends on 39.
#
#===============================================================================
module DTEOH
 
  #Show message when experience is gained?
  SMWEG = true

end
#==============================================================================
# ** Game_ActionResult
#------------------------------------------------------------------------------
#  This class handles the results of battle actions. It is used internally for
# the Game_Battler class.
#==============================================================================

include DTEOH
class Game_ActionResult
  #--------------------------------------------------------------------------
  # * Create Damage
  #--------------------------------------------------------------------------
  def make_damage(value, item)
    @critical = false if value == 0
    @hp_damage = value if item.damage.to_hp?
    @mp_damage = value if item.damage.to_mp?
    @mp_damage = [@battler.mp, @mp_damage].min
    @hp_drain = @hp_damage if item.damage.drain?
    @mp_drain = @mp_damage if item.damage.drain?
    @hp_drain = [@battler.hp, @hp_drain].min
    @success = true if item.damage.to_hp? || @mp_damage != 0
    gain_exp
  end
end
  #--------------------------------------------------------------------------
  # * EXP Acquisition and Level Up Display
  #--------------------------------------------------------------------------
  def gain_exp
    $game_party.all_members.each do |actor|
    actor.gain_exp($game_troop.exp_total)
  end
  display_exp if DTEOH::SMWEG
end
  #--------------------------------------------------------------------------
  # * Display EXP Earned
  #--------------------------------------------------------------------------
  def display_exp
    if $game_troop.exp_total > 0
      text = sprintf(Vocab::ObtainExp, $game_troop.exp_total)
      $game_message.add('\.' + text)
    end
  end
#==============================================================================
# ** BattleManager
#------------------------------------------------------------------------------
#  This module manages battle progress.
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # * Display EXP Earned
  #--------------------------------------------------------------------------
  def self.display_exp
    nil
  end
end

Credit


  • DoctorTodd

Thanks

  • Thanks to Fable 2 for the idea.

Support


Post here for quickest support, or send an email to Todd@beacongames.com.

Known Compatibility Issues

None known of.

Demo


Download

Author's Notes


I have been thinking about Fable 2 recently so I decided to write this.

Restrictions

Check the header of the script.

**
Rep: +0/-0Level 57
Wandering RMer
wow nice script doctor :D
but I don't have project in VXA :V
but it good for my collection :)

****
Rep:
Level 71

****
Bitch
Rep:
Level 87
Bits'n'Pixels
I'm utterly new to VXA/Scripting so am trying to avoid scripting too much until I understand it all more, but this one just sounded too cool to pass up, however I'm having trouble getting it to work.  I tried reading over all that, but I'm not a coder on the best of days so am pretty lost.
I read the wee mini-tut on the boards and have your script pasted in its own section, just above main and haven't changed anything, but I'm just not seeing the effects in game. :(

Is there something I'm supposed to be editing and have missed, or am I likely just being crap at scripting?

Cheers in advance, and kudos on the cool script :)

****
Rep:
Level 71
Odd... I'll take a look at it, in the mean time did you try the demo?

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Not yet; I've got a few to get through!  I wanted to avoid VX versions to avoid the temptation of buyin' it, but now I finally have it I want t try get my progress back to at least where it was in 2K3 so I can slow down and focus on learning more and finding out why I keep brealing all the scripts I try!! QQ

****
Rep:
Level 71
Alright just let me know when you try the demo.

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
And for DTs script I was setting up events to trigger random battles so I could test it.  Monsters weren't high on my priority list so I just made a quicky monster and set it for a random encounter event (thinking that test plays might not have it).  Does that mean there's a problem otherwise or that it just doesn't apply on event-based encounters?
Actually I tried multiple things and I frankly can't figure out why it doesn't work for your game.


DoctorTodd, would you mind looking at this?
http://www.mediafire.com/?t4tw59bzw66gbm6

Things I already tried.
  • Copying the original script here to replace the one that was in it.
  • Comparing the databases from your demo and his game. Aside from using different characters and having a few things changed in the Vocab. Nothing should break your script.
  • Playing around with some settings, to no avail.
  • Multitasking from random battles to evented battles

I think the most likely problem is that he is using a custom monster as his troop encounter.
That's what I think anyway.
« Last Edit: June 03, 2012, 07:29:37 PM by D&P3 »
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Well, as scary as it sounds for experienced scripters to be baffled, it's at least a bit reassuring that it's not (neccessarily, I hope) just a huge cock-up on my end :D

Whatever the outcome, cheers to both of you for your help :)
Hopefully it gets resolved, cuz it's a damn nice sounding script and I'd love to have it in my game~

****
Rep:
Level 71
Ya I'm pretty confused.  :o
I tried putting it in a new project and it worked, I did encounter an error where it's not displayed during the first turn which I will hopefully fix soon.

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Well, just to ease any concerns you may have about the script, it's...working suddenly. o.o
Just loaded up another test run to make sure an item event I had worked fine and during a random battle started getting experience for each hit.  I'm assuming the script works on giving as much exp per hit as the monster is designated to give?  If so, appears to be working fine now, will make a mention if it stops again.

Hope it sticks, 'cuz it's a fun script.  Especially like the option to turn off the message :)  Cheers again, you two~

****
Rep:
Level 71
Well it's good to hear it's working now! 

****
Bitch
Rep:
Level 87
Bits'n'Pixels
I'm not sure if whatever made it work has made it buggy or if it was intentional and I'm just missing patterns, but it seems to be playin' up a bit.

The exp never seems to be applied on the first turn
Second turn a couple of messages come up, I think this is some delay from the first turn, but on one-turn wins, there's no exp at all.
Am almost certainly getting exp from enemies attacks as well, unless the script is giving them exp for attacking me and displaying it.
After a few turns, the exp starts ramping up hugely, almost doubling up each turn.  Went from 86 (the set amount), to 150ish to over 200xp per hit over three turns.

Thoughts?

(also, got your game over menu script too; brilliant wee script :) )
« Last Edit: June 05, 2012, 06:16:03 AM by Brady »

****
Rep:
Level 71
In that case I have to do some major revisions to the script, I'll try to get on it right away. Glad you like my game over script.  :)

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Hopefully it's nothing major!  I tried looking over it all for anythin' I'd understand, but scripts really arenae my language :(

I'll be keeping an eye on this though :)

**
Rep:
Level 56
RMRK Junior
Sorry to go off-topic, but are you Scottish Brady?

We're the only country I know of that types in its regional accent and dialect. :P
It's more like a big ball of wibbly wobbly...timey wimey...stuff.

****
Bitch
Rep:
Level 87
Bits'n'Pixels
Sorry to go off-topic, but are you Scottish Brady?

We're the only country I know of that types in its regional accent and dialect. :P

Aye...y'know I've never really thought about that before...seems natural to me, but now you mention it...cannae think of another place that does that...unless they do it within other languages o_o'