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.
Scene_Battle Question

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
Menu & Battle System Guru
I'm trying to make a system that enables a slight recovery of SP everytime a character's turn comes up, but also uses a certain amount of SP whenever the character decides to Attack and Use an item. And, of course, the Defend command (called Rest) will be used to Recover more SP, and the Skill will have its normal functioning. However, I have no idea where to input this....like whenever a turn occurs and whenever a certain command is used.

Any ideas?

thanks!


p.s. the new forum layout looks siiiiiick.

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
def make_item_action_result and def make_attack_action_result, there you can add something like i.e. @active_battler.sp -= 20. The recover:

Code: [Select]
class Scene_Battle
 
  alias start_phase4_recover_later start_phase4
  def start_phase4
    start_phase4_recover_later
    for actor in $game_party.actors
      actor.sp += 20
      actor.sp += 50 if actor.current_action.kind == 0 and actor.current_action.basic == 1
    end
    @status_window.refresh
  end
 
end

Just change the numbers like you want them.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Menu & Battle System Guru
wow blizz you never fail to impress.  ;D The attack and item worked, but I got a system stack error with the new alias. I wonder if it did that when the maxsp was already maxed out and when it tried recovering more it somehow crashed. Either that or i put it in a bad spot (Scene_Battle 4 right under disabling of the windows). What do you think?

also, any ideas of how i should/could go about displaying exactly how much is recovered (like number pop on the character and not just the gradient fill)?

thanks;)

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Try it this way.

Code: [Select]
class Scene_Battle
 
  alias start_phase4_recover2_later start_phase4
  def start_phase4
    start_phase4_recover2_later
    for actor in $game_party.actors
      unless actor.dead?
        actor.sp += 20
        actor.sp += 50 if actor.current_action.kind == 0 and actor.current_action.basic == 1
      end
    end
    @status_window.refresh
  end
 
end

For display just add below any of the SOMETHING.sp += NUMBER a SOMETHING.damage = -NUMBER and the gain will be displayed as well. Basically putting it under Scene_Battle 4 should work fine if you're not using any CBS-es or special battle add-ons.
« Last Edit: March 02, 2007, 09:18:03 PM by Blizzard »
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Menu & Battle System Guru
hmmm i'm still getting a S.O.B. systemstackerror. i've been placing it under the disabling of windows in the def start_phase4, think it could have something to do with 2 def start_phase4's?

LOL, i was actually putting it IN Scene_battle 4 rather than in its own script right below it.

« Last Edit: March 02, 2007, 10:32:23 PM by blazinhandle »

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Try it without the code. This was aliased with a name that shouldn't appear anywhere else in your script. =/
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Menu & Battle System Guru
i'm sorry for being a pest man, but how could i disable attack and item if the needed SP wasn't availible?

btw, im testing out the displaying of recovery SP.
I set the display up like this (just an example of how i did it for Item):

Code: [Select]
  def make_item_action_result
    # Get item
    @item = $data_items[@active_battler.current_action.item_id]
    # If unable to use due to items running out
    unless $game_party.item_can_use?(@item.id)
      # Shift to step 1
      @phase4_step = 1
      return
    end
    # If consumable
    if @item.consumable
      # Decrease used item by 1
      $game_party.lose_item(@item.id, 1)
    end
    # Use of STAMINA!!!!
    @active_battler.sp -= @active_battler.maxsp/10
    # Display just how much STAMINA is used
    @active_battler.damage = -@active_battler.sp
    # Display item name on help window
    @help_window.set_text(@item.name, 1)
    # Set animation ID
    @animation1_id = @item.animation1_id
    @animation2_id = @item.animation2_id
    # Set common event ID
    @common_event_id = @item.common_event_id
    # Decide on target
    index = @active_battler.current_action.target_index
    target = $game_party.smooth_target_actor(index)
    # Set targeted battlers
    set_target_battlers(@item.scope)
    # Apply item effect
    for target in @target_battlers
      target.item_effect(@item)
    end
  end

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
Should be like this:

Code: [Select]
    @active_battler.sp -= @active_battler.maxsp/10
    @active_battler.damage = -@active_battler.maxsp/10

And about the disable... Well, you need a little bit more code for that. The SP need to be checked during the setup of the command window and the attack should be disabled according to the left SP.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Menu & Battle System Guru
okay well i've got the disabling squared away but i still cant get the SP recovery/drought is be displayed even when i set it up like that :-\

********
EXA
Rep:
Level 92
Pikachu on a toilet
Project of the Month winner for April 2007
I forgot something. You need that third thing as well. (^__^')

Code: [Select]
    @active_battler.sp -= @active_battler.maxsp/10
    @active_battler.damage = -@active_battler.maxsp/10
    @active_battler.damage_pop = true
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.


Get DropBox, the best free file syncing service there is!

***
Rep:
Level 88
Menu & Battle System Guru
lol still nothing, no worries tho blizz it's not a big deal 8)

****
Banned
Rep:
Level 88
I'm basically Yoda's brother
bliz, can you make me a script that makes it so at the begining of your turn each of your heroes gains 10 sp. but you don't lose any unless you use a skill.

and outside a battle: for every 100 steps that your hero makes, all of your heroes gain 10 sp.

can you do that for me?

just so everyone knows, im 15 years old.

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
100 steps can be done with events...might be hard I guess but you could use button imput for arrow keys that would add to a variable called walking, which is reset at 101
but when = 100 change Sp
Watch out for: HaloOfTheSun

***
Rep:
Level 88
Menu & Battle System Guru
bliz, can you make me a script that makes it so at the begining of your turn each of your heroes gains 10 sp.

class Scene_Battle
 
  alias start_phase4_recover2_later start_phase4
  def start_phase4
    start_phase4_recover2_later
    for actor in $game_party.actors
      unless actor.dead?
        actor.sp += 10
      end
    end
    @status_window.refresh
  end
 
end

****
Banned
Rep:
Level 88
I'm basically Yoda's brother
thanks, but I still need:
Quote
outside a battle: for every 100 steps that your hero makes, all of your heroes gain 10 sp.

and I don't really want to do it in events.

just so everyone knows, im 15 years old.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
and I don't really want to do it in events.
It is MUCH easier to do in events. Just read this short little pic I made.

****
Banned
Rep:
Level 88
I'm basically Yoda's brother
thats really complicated. :(

just so everyone knows, im 15 years old.

***
Rep:
Level 88
Menu & Battle System Guru
thats really complicated. :(

i'm sorry dude but it's really not, he's laid EVERYTHING out for you. it would take maybe 5 minutes to copy and then another 10 to understand it as he's labled EVERYTHING that he's done and explained it thoroughly.

btw man, you've pretty much started a completely new topic in someone else's post. I'm not mad or anything dude, you'd just get a little more help if you were a bit more respectful. but yeah, just take the time to read through that, ingest it, and you'll be able to apply it no problem ;)

****
Banned
Rep:
Level 88
I'm basically Yoda's brother
sorry about the "making a new post in someone elses post" thing. I just thought that his idea was good, so i asked if i could find "my" version of it.

I looked over the pic shinami made, and it made alot more sense. thanks you!

just so everyone knows, im 15 years old.

***
Rep:
Level 88
Menu & Battle System Guru
good stuff ;)