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.
Spliting EXP [RESOLVED]

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 87
Normally the game runs it so even if you four people they all get the same amount of EXP. i want it so that it rewards doing it with less living people at the end of the battle (so going solo gives more exp, but if you have 4  ppl in your party, you only give 1/4 to each player). Is there a script or something that can do that? ;8
« Last Edit: July 08, 2007, 09:56:16 AM by Legacy »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Yeah, easy. Just got to Scene_Battle 2 in the editor, go to somewhere around line 172 (inside method: start_phase5) and replace this line:

Code: [Select]
actor.exp += exp

with this:

Code: [Select]
actor.exp += exp/$game_party.actors.size

The entire start_phase5 method should look like this:

Code: [Select]
def start_phase5
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        # Add EXP and amount of gold obtained
        exp += enemy.exp
        gold += enemy.gold
        # Determine if treasure appears
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp/$game_party.actors.size
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result window
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # Set wait count
    @phase5_wait_count = 100
  end

*
Rep:
Level 87
NICE! thx i've been looking for that for a while. You wouldn't happen to know how to add and remove party members (Manually by the player so they can choose to fight alone, with a certain party structure...ect.) but not only out of battle but in battle too.

*******
Rep:
Level 90
Returned from the dead.
This shoulda been in the scripts forum in my opinion :-\
Sincerely,
Your conscience.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Errm... that's true, but he probably didn't know it's best done by a script.

As for your second question, you'd need a script. It doesn't seem too difficult. I suggest you make a request in the Simple Script Shop. If they refuse you, then I might be able to do it, but it'd probably be a little on the later side, as my list of things to do before it is:

  • write lessons for my eventing students
  • finish my inventory script
  • finish my freeform add-on pack script
  • there's something else I've forgotten

In any case, it'd be a minimum of two weeks before I could get on it, so ask the nice people at the Script Shop

*******
Rep:
Level 90
Returned from the dead.
:-\ I dont think i'd be able to do that :-\

Maybe NAM could but dont get your hopes up too high
Sincerely,
Your conscience.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I think you could. It is essentially just a switch. You'd probably just need to set up a dummy array which holds all the actors, and use comparison between that and $game_party to draw the list. If you need to find how to add and remove members through scripts, check out the interpreter class and see how it is done.

*******
Rep:
Level 90
Returned from the dead.
...
help...

I dont know what half the stuff there is :tpg:
Sincerely,
Your conscience.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
well, that would kind of be awkward anyway, so I'll tell you. To add an actor, just do this:

$game_party.add_actor (actor id)

and to remove:

$game_party.remove_actor (actor id)

So now, all you have to do is preserve the original $game_party.actors in an array (this is probably the most difficult part of the script, surprisingly), and then provide a selection based on this array (so the names of all in the party), and what occurs when you select each name can essentially be reduced to a comparison:

if actor in $game_party.actors, remove, if actor not in $game_party.actors, add.

That'd be my idea at least. You might need to adjust his menu script a little to switch dependence from $game_party.actors to your new array. If you decide to do it and run into any problems, don't hesitate to ask for advice.

*******
Rep:
Level 90
Returned from the dead.
I still dont understand much :-\
Sincerely,
Your conscience.