Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

3 Pages V  < 1 2 3  
Reply to this topicStart new topic
> [Scripting]Advanced Windows, A tutorial from the Script Builders
Redd
post Dec 10 2009, 12:14 PM
Post #41


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




Um i'm having a bit of an issue here. Whenever I call Hero_1, Hero_2, and Hero_3, they all come up and after a while, Hero_1 and Hero_2 go down and Hero_3 stays up. What am I doing wrong?

Here's the script:

CODE
class Hero_1 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 173, 120)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 100
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    actor = $game_party.actors[000]
    draw_actor_name(actor, 0, 0)
    draw_actor_hp(actor, 0, 30)
    draw_actor_sp(actor, 0, 60)
  end
end
#-------------------------------------------------------------------------------
class Hero_2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(174, 0, 173, 120)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 100
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    actor = $game_party.actors[001]
    draw_actor_name(actor, 0, 0)
    draw_actor_hp(actor, 0, 30)
    draw_actor_sp(actor, 0, 60)
  end
end
#-------------------------------------------------------------------------------
class Hero_3 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(347, 0, 173, 120)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 100
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    actor = $game_party.actors[002]
    draw_actor_name(actor, 0, 0)
    draw_actor_hp(actor, 0, 30)
    draw_actor_sp(actor, 0, 60)
  end
end


That's just the main, non commented stuff.


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 10 2009, 01:45 PM
Post #42


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Are you sure that you made your event also dispose of Hero_3?


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Redd
post Dec 10 2009, 04:10 PM
Post #43


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




I didn't make it dispose of anything. I didn't want it to.


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 13 2009, 06:17 PM
Post #44


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Hey, sorry for the late response, kept forgetting to reply sad.gif

QUOTE
I didn't make it dispose of anything. I didn't want it to.


So what does your event look like, then?


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Redd
post Dec 13 2009, 06:23 PM
Post #45


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced






That's what the common event looks like. It turns on using a switch.

Except it wasn't supposed to have that dispose in there, and it's supposed to be Autorun. I wonder who changed it *looks at brother*


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 14 2009, 01:36 PM
Post #46


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Ah, I see the problem. You're event should look like this:

CODE
$window1 = Hero_1.new
$window2 = Hero_2.new
$window3 = Hero_3.new
$window1.dispose
$window2.dispose
$window3.dispose


The problem with yours is that you keep reassigning $window so that when you dispose $window, only Hero_3 is diposed so we have to make three seperate windows and dispose all three seperately.


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Redd
post Dec 14 2009, 04:16 PM
Post #47


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




But I don't want them to dispose. I added that at the bottom. I want them to stay there so you can look at them forever if that switch is on.


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 14 2009, 04:34 PM
Post #48


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Then it should look like this:

CODE
$window1 = Hero_1.new
$window2 = Hero_2.new
$window3 = Hero_3.new


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Redd
post Dec 16 2009, 02:58 PM
Post #49


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




Even though I do have it like that, it still takes out the first and second one and keeps the third one up. WHY?


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 16 2009, 06:46 PM
Post #50


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Do you want the first and second windows to go away or is it a matter of whether a switch is on or not. So basically, when a switch is on, do you want the windows to pop up and if the switch is off, you want the windows to go away?


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Redd
post Dec 18 2009, 08:10 AM
Post #51


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




Exactly!


__________________________
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post Dec 18 2009, 11:35 AM
Post #52


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




Who say a scripter cant post homework? XD I always hate it when there's a hud that just get's in the way.
you cant make it disappear, or to do so you have to press some key that you forget to do, and it's even worse when the HUD blocks an item or something important.
[Show/Hide] hidden!
Attached File  Image1.png ( 19.06K ) Number of downloads: 1

So I decided to make the window and cause it's opacity to auto-correct if the player is being obscured by it. (i didnt decorate it much, but hey, the opacity auto adjusts!) great tutorial, law.
[Show/Hide] OMG I CAN SEE
Attached File  Image7.png ( 171.91K ) Number of downloads: 8


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 18 2009, 03:57 PM
Post #53


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




@Redd: Alright, I think I get it now, can you show me a screenie of what the event looks like that calls the common event or turns the switch on?

@NightShade: Awesome work, man, love it smile.gif And that opacity thing you did is really amazing, great work biggrin.gif


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Redd
post Dec 19 2009, 06:05 PM
Post #54


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




What it does is you click on the dude which turns Switch 0001 ON, which activates this common event.


__________________________
Go to the top of the page
 
+Quote Post
   
The Law G14
post Dec 19 2009, 07:43 PM
Post #55


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Alright, I think I figured it all out. First of all, make a new common event called 3 Man Stats[ON]. Set the trigger to none and inside this common event, go to page three of the list of event commands and go down to 'Script' to copy this code in:

CODE
$window1 = Hero_1.new
$window2 = Hero_2.new
$window3 = Hero_3.new


After that, make and turn on a conditional switch named 3 Man Stats so that your common event should look like this:

CODE
$window1 = Hero_1.new
$window2 = Hero_2.new
$window3 = Hero_3.new
Control Switches: [0001: 3 Man Stats] = ON


Next, make the event on the map that allows you to see your stats. Just make an event and go to the first page of the list of event commands and pick Call Common Event and pick the common event we just made.

Finally, make the event that disposes of the windows. Open up the event and make a new event page that turns on if the 3 Man Stats Switch is on. In this new event page, put in a script event command that looks like this:

CODE
$window1.dispose
$window2.dispose
$window3.dispose


Then after that, turn the 3 Man Stats switch off.

Hope that helps smile.gif




__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   

3 Pages V  < 1 2 3
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 08:13 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker