iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!

> ATTENTION!

Do not post questions about Ace in this section. Any and all Ace related support should be posted in the Ace section found here.

 
Closed TopicStart new topic
> Astra State
Crystal King
post Jun 30 2011, 05:09 PM
Post #1



Group Icon


Type: Designer
Alignment: Neutral Good




I was wondering if anybody had a way to create a state called Astra. Astra is a state that prevents the next debuff from hitting, but only once. So if a character is under the effects of Astra, and an enemy tries to blind him, Astra will cancel out the blind, and then go away itself.

I have browsed over the state scripts, and thought that I found a way to do it using Deriru's statuses, using the Null Element feature. I created a new element called debuff. I then created a status named Astra, that would prevent against element 19 (the debuff element). However, when my character is under the Astra effect, he can still be blinded, or poisoned.

Does anyone have any idea how to accomplish this?

Edit: Thanks for the Move BigEd! Now that it's in the script requests, I would like to thank any scripters in advance!

This post has been edited by Crystal King: Jun 30 2011, 05:22 PM


--------------------


The eventing cure to Eventor's Bane!
http://www.rpgmakervx.net/index.php?s=&...st&p=470372
Go to the top of the page
 
+Quote Post
   
BigEd781
post Jun 30 2011, 05:11 PM
Post #2


No method: 'stupid_title' found for 'nil:NilClass`
Group Icon


Type: Coder
Alignment: Chaotic Good




I'm going to go ahead and move this to the Script Request forum for you, but I'll leave a link here. It should be pretty simple; you just need to check for that state before ever applying a debuff (you will need to configure which states are considered debuffs of course.) I would do it but, you know, I'm at work. biggrin.gif


--------------------
My blog - It's awesome, I assure you
QUOTE
While sloppy writing does not invariably mean sloppy thinking, we've generally found the correlation to be strong -- and we have no use for sloppy thinkers. If you can't yet write competently, learn to. - Eric Raymond

---
My awards for being so awesome
Spoiler:
Go to the top of the page
 
+Quote Post
   
Zetu
post Jun 30 2011, 05:24 PM
Post #3


Has broken out of Staby Rehab!
Group Icon


Type: Undisclosed
Alignment: Chaotic Evil




As Ed said, easy-peasy...

Spoiler:
CODE
class RPG::State
  
  def astra?
    self.note.scan(/<astra>/i){
    return true}
    return false
  end
  
  def nastra?
    self.note.scan(/<nastra>/i){
    return true}
    return false
  end
  
end

class Game_Battler
  
  def has_astra?
    for state in states
      return true if state.astra?
    end
  end
  
  alias z15_add_state add_state
  def add_state(state_id)
    state = $data_states[state_id]
    return if state == nil
    return if state_ignore?(state_id)
    unless state_offset?(state_id)
      if self.has_astra? and state.nastra?
        debuff_astra
        return
      end
    end
    z15_add_state(state_id)
  end
  
  def debuff_astra
    for state in self.states
      if state.astra?
        @states.delete(state.id)
        return
      end
    end
  end
  
end


Just add <astra> to the state you want to be considered Astra, and <nastra> to the states you want Astra to cancel.


--------------------
My Scripts:

Best. Error. Evah!!!
Spoiler:


Team JIFZ: Jet, Ice, Fenix, Zetu

A stabbing Gesture is a friendly Gesture
Go to the top of the page
 
+Quote Post
   
Crystal King
post Jun 30 2011, 05:38 PM
Post #4



Group Icon


Type: Designer
Alignment: Neutral Good




Works perfectly! Thanks for your help!


--------------------


The eventing cure to Eventor's Bane!
http://www.rpgmakervx.net/index.php?s=&...st&p=470372
Go to the top of the page
 
+Quote Post
   
BigEd781
post Jun 30 2011, 05:44 PM
Post #5


No method: 'stupid_title' found for 'nil:NilClass`
Group Icon


Type: Coder
Alignment: Chaotic Good




Ahh, I just love it when the community comes together like this. Puts me in the mood for s'mores and Kumbaya.


--------------------
My blog - It's awesome, I assure you
QUOTE
While sloppy writing does not invariably mean sloppy thinking, we've generally found the correlation to be strong -- and we have no use for sloppy thinkers. If you can't yet write competently, learn to. - Eric Raymond

---
My awards for being so awesome
Spoiler:
Go to the top of the page
 
+Quote Post
   
Rekam Gpr
post Jan 15 2012, 06:25 PM
Post #6



Group Icon


Type: Undisclosed




Hello!

Sorry for reviving the topic, but I was testing the script and unfortunately it didn't work properly.

I tested in the RMVX's Default Battle System, but every state that is marked with <nastra> tag is never applied, regardless of the character is or isn't protected with Astra.

This happened to someone else? Can someone help me?

Thanks!
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th July 2014 - 04:52 PM

RPGMakerVX.net is an Privacy Policy, Legal.