iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

The 2nd Quarter Contest has arrived! Go check it out in the Community Announcements now!

> 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
> [SOLVED] Determine if "in battle" using a conditional branch, possibly using the script condition
Venima
post Sep 7 2012, 03:12 PM
Post #1


Solution Finder
Group Icon


Type: Designer
Alignment: True Neutral




I've tried looking around and haven't found a solution that works for my case.

I have an item which is supposed to have different effects based on whether we're in battle or not.
If you want specifics, when outside of battle, it adds a complimentary state to the player, when in battle it attacks the enemy of choice. I have a common event called and it all works, apart from the conditional branch that checks if they're in battle currently only checks if enemy 1 is around, which doesn't work properly when there are multiple enemies.

This post has been edited by Venima: Sep 8 2012, 12:27 PM


--------------------
Want to impress people with bridges that you can walk both over and under? What about using the ceiling as pavement? Find out how here!

"Ho there wanderer. Stay thy course a moment, to indulge an old man."

An RPG needs love, tragedy and plenty of near death experiences to keep players on their toes!

"The Lord of Murder shall perish, but in his doom he shall spawn a score of mortal progeny, chaos will be sown by their passage, -so sayeth, the wise Alaundo"

Spoiler:
Designer: ≈≈≈≈≈
Spriter: ≈
Artist: ≈≈
Eventer: ≈≈≈≈≈
Script Coder: ≈≈
Writer: ≈≈≈≈
Musician: ≈
Baldur's Gate Enthusiast: ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
Go to the top of the page
 
+Quote Post
   
DP3
post Sep 7 2012, 03:59 PM
Post #2


Swinging a chain in a town near you.
Group Icon


Type: Writer
Alignment: Lawful Neutral




Try this

Spoiler:
CODE
class Scene_Battle < Scene_Base
  #------------------------
  # Editable Part
  #------------------------
  
  # Event Switch to turn on if in battle
  ITEM_EVENT_SWITCH_ID = 10
  
  #------------------------
  
  
  
  
  
  
  
  
  
  
  
  
  
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias evntswitchbtlstart_1g5s start
  def start
    evntswitchbtlstart_1g5s
    $game_switches[ITEM_EVENT_SWITCH_ID] = true
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias evntswitchbtlterminate_1g5s terminate
  def terminate
    evntswitchbtlterminate_1g5s
    $game_switches[ITEM_EVENT_SWITCH_ID] = false
  end
end


--------------------
Go to the top of the page
 
+Quote Post
   
Venima
post Sep 7 2012, 04:58 PM
Post #3


Solution Finder
Group Icon


Type: Designer
Alignment: True Neutral




So then with the conditional branch, I just check against the switch with that id?


--------------------
Want to impress people with bridges that you can walk both over and under? What about using the ceiling as pavement? Find out how here!

"Ho there wanderer. Stay thy course a moment, to indulge an old man."

An RPG needs love, tragedy and plenty of near death experiences to keep players on their toes!

"The Lord of Murder shall perish, but in his doom he shall spawn a score of mortal progeny, chaos will be sown by their passage, -so sayeth, the wise Alaundo"

Spoiler:
Designer: ≈≈≈≈≈
Spriter: ≈
Artist: ≈≈
Eventer: ≈≈≈≈≈
Script Coder: ≈≈
Writer: ≈≈≈≈
Musician: ≈
Baldur's Gate Enthusiast: ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
Go to the top of the page
 
+Quote Post
   
Solistra
post Sep 7 2012, 06:52 PM
Post #4



Group Icon


Type: Writer
Alignment: Lawful Evil




Yes, that would be the idea. There are ways to do this without using up a switch, too, but this is probably the easiest method for you to use.


--------------------
Go to the top of the page
 
+Quote Post
   
Venima
post Sep 8 2012, 12:27 PM
Post #5


Solution Finder
Group Icon


Type: Designer
Alignment: True Neutral




Just tested it, it works thanks biggrin.gif


--------------------
Want to impress people with bridges that you can walk both over and under? What about using the ceiling as pavement? Find out how here!

"Ho there wanderer. Stay thy course a moment, to indulge an old man."

An RPG needs love, tragedy and plenty of near death experiences to keep players on their toes!

"The Lord of Murder shall perish, but in his doom he shall spawn a score of mortal progeny, chaos will be sown by their passage, -so sayeth, the wise Alaundo"

Spoiler:
Designer: ≈≈≈≈≈
Spriter: ≈
Artist: ≈≈
Eventer: ≈≈≈≈≈
Script Coder: ≈≈
Writer: ≈≈≈≈
Musician: ≈
Baldur's Gate Enthusiast: ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
Go to the top of the page
 
+Quote Post
   
Virus 9
post Sep 8 2012, 12:35 PM
Post #6


Evil is a virus that spreads!
Group Icon


Type: Writer
Alignment: Chaotic Evil




Good. I will be closing it then. Glad to see someone was good help as DP3 is always one with great provided help.
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 April 2014 - 09:57 PM

RPGMakerVX.net is an Privacy Policy, Legal.