The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old August 23rd, 2010, 01:51 PM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
My original thread can be found at: http://www.planetdev.net/index.php?showtopic=507
Well I'm gonna start up with a high demand from people with the touch screen ability within Pokemon Essentials.
You will need the mouse module and the dualscreen script by Cng. And obviously Pokemon Essentials.

The first step you need to do is create a button graphic about 50X50 in size.
In a script you need to set up the sprite display for the button(Judging that most people will choose the menu script)
To set up the first button display you need to do the following code:

Code:
@button1=Sprite.new
@button1.x = # Change the # to the value of the displayed graphic's verticle appearance
@button1.y = # Change the # to the value of the displayed graphic's horizontal appearance
@button1.z = 100 # This sets the priority of the button over other graphics
@button1.bitmap = RPG::Cache.picture("insert graphic name here") # defines the graphic
That sets up the button graphic for the first button
To set up the mouse part of the script as to where to click and where the mouse needs to be you need to find the loop do method of the script:
Do the following:

Code:
if Mouse.mouse_in_area?(x,y,width,height) # change the x and y to the co-ordinates on screen change the width and height to the size of the graphic
  if Mouse.click?(1) # checks if the left mouse button is clicked
	#this is where you define the actions of the button
  end
end
And that should be all you need to do in-order to set up the whole touch screen method. Just make sure you have set the button up properly with what it needs to do and check that you know exactly what to do within scripting before you try to do this.

Here's an example of a working button:

Code:
	  if Mouse.mouse_in_area?(21,353,60,39)
		if Mouse.click?(1)
		  $game_system.se_play($data_system.decision_se)
		  pbFadeOutIn(99999) {
		  scene=PokemonPokedexScene.new 
		  screen=PokemonPokedex.new(scene) 
		  screen.pbStartScreen 
		  }
		end
	  end
That is an example of a pokedex button.

Well that's it for now but I will add in extra tutorials in the near future.
__________________

Pokémon: Lost Souls.







Developed by Carmaniac.
Reply With Quote
  #2    
Old August 29th, 2010, 05:25 AM
matrockista06
Beginning Trainer
 
Join Date: Jun 2009
Gender: Male
WHERE WOUL I POST EACH CODES PLS. HELPT^T
Reply With Quote
  #3    
Old August 29th, 2010, 08:48 AM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
You put them in a script that you want a touch screen effect with. I've only shown how to do it so people need to have some basic scripting knowledge otherwise this tutorial is useless.
__________________

Pokémon: Lost Souls.







Developed by Carmaniac.
Reply With Quote
  #4    
Old August 30th, 2010, 04:31 AM
bigtukker
 
Join Date: Mar 2009
Gender:
How can I change the font, and then I mean a less pixelated font.
Reply With Quote
  #5    
Old August 31st, 2010, 06:57 AM
Luka S.J.'s Avatar
Luka S.J.
S.J.Ware HD
 
Join Date: Dec 2008
Age: 21
Gender: Male
Nature: Adamant
That would be kind of irritating to use. The whole method of loading the image is just way too fiddly. How about placing

Code:
def MouseOver?(image) #place the name of your image (something like @button) only after you've defined its X and Y co-ordinates

  if Mouse.mouse_in_area?(image.x,image.y,image.bitmap.width,image.bitmap.height)
    return true
  else
    return false
  end

end
in PokemonUtilities and if you want to set mouse commands just use

Code:
if MouseOver?(@button)
and to make it even more simplified for left clicking

Code:
def MouseLeftClick?(image) #place the name of your image (something like @button) only after you've defined its X and Y co-ordinates

  if Mouse.mouse_in_area?(image.x,image.y,image.bitmap.width,image.bitmap.height) && Mouse.click?(1)
    return true
  else
    return false
  end

end
don't you think that would make your life a bit easier?
__________________
[STOPPED][DEMO] Pokemon Blue Chrome
[DEVELOPING] S.J.Ware
[DEVELOPING] Tykanite
Reply With Quote
  #6    
Old September 2nd, 2010, 07:37 AM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
Code:
---------------------------
Pokemon New Dawn1
---------------------------
Script 'Menu' line 6: NoMethodError occurred.

undefined method `mouse_in_area?' for Mouse:Module
---------------------------
OK   
---------------------------
Thats the error i'm getting and here is my script:
Code:
@button1=Sprite.new
@button1.x = 50
@button1.y = 75
@button1.z = 100 # This sets the priority of the button over other graphics
@button1.bitmap = RPG::Cache.picture("Pokedex Button") # defines the graphic
  if Mouse.mouse_in_area?(21,353,60,39)
		if Mouse.click?(1)
		  $game_system.se_play($data_system.decision_se)
		  pbFadeOutIn(99999) {
		  scene=PokemonPokedexScene.new 
		  screen=PokemonPokedex.new(scene) 
		  screen.pbStartScreen 
		  }
		end
	  end
__________________

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
Reply With Quote
  #7    
Old September 2nd, 2010, 08:24 AM
Rai Rai's Avatar
Rai Rai
Master of everything!
 
Join Date: Aug 2010
Gender: Male
Quote:
Originally Posted by Pichuichu View Post
Code:
---------------------------
Pokemon New Dawn1
---------------------------
Script 'Menu' line 6: NoMethodError occurred.

undefined method `mouse_in_area?' for Mouse:Module
---------------------------
OK   
---------------------------
Thats the error i'm getting and here is my script:
Code:
@button1=Sprite.new
@button1.x = 50
@button1.y = 75
@button1.z = 100 # This sets the priority of the button over other graphics
@button1.bitmap = RPG::Cache.picture("Pokedex Button") # defines the graphic
  if Mouse.mouse_in_area?(21,353,60,39)
		if Mouse.click?(1)
		  $game_system.se_play($data_system.decision_se)
		  pbFadeOutIn(99999) {
		  scene=PokemonPokedexScene.new 
		  screen=PokemonPokedex.new(scene) 
		  screen.pbStartScreen 
		  }
		end
	  end
You've set it up wrong. It should be something like this:

Code:
@button1=Sprite.new
@button1.x = 50
@button1.y = 75
@button1.z = 100 # This sets the priority of the button over other graphics
@button1.bitmap = RPG::Cache.picture("Pokedex Button.png") # defines the graphic
update
def update
  if Mouse.mouse_in_area?(50,75,60,39)
    if mouse.click?(1)
      $game_system.se_play($data_system.decision_se)
      pbFadeOutIn(99999) {
      scene=PokemonPokedexScene.new
      screen=PokemonPokedex.new(scene) 
      screen.pbStartScreen 
       }
       end
   end
end
Reply With Quote
  #8    
Old September 2nd, 2010, 09:32 AM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
umm my mouse doesn't show up and i can't click it?
__________________

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
Reply With Quote
  #9    
Old September 3rd, 2010, 07:33 AM
Gigatom~'s Avatar
Gigatom~
Pokemon Ruthenium Creator ~
 
Join Date: Jan 2010
Age: 19
Gender: Male
Quote:
Originally Posted by Pichuichu View Post
umm my mouse doesn't show up and i can't click it?
Yeah, you'll need to script a bit to make it work.
The Scripts in this thread are only the basics for a TouchScreen.
__________________


Check out my deviantArt! :3
Reply With Quote
  #10    
Old September 3rd, 2010, 07:50 AM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
oh okay. thanksfor those tips.
__________________

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
Reply With Quote
  #11    
Old September 3rd, 2010, 08:13 AM
Gigatom~'s Avatar
Gigatom~
Pokemon Ruthenium Creator ~
 
Join Date: Jan 2010
Age: 19
Gender: Male
Quote:
Originally Posted by Pichuichu View Post
oh okay. thanksfor those tips.
No Problem :)
Btw, your Pokemon New Dawn Thread layout is amazing,
who made it ?
__________________


Check out my deviantArt! :3
Reply With Quote
  #12    
Old September 3rd, 2010, 08:45 AM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
It says so at the botom of the first post scroll down and look a the credit's. and thanks. Btw when are you posting the ruthenium thread?
__________________

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
Reply With Quote
  #13    
Old October 30th, 2010, 04:50 PM
Urugamosu's Avatar
Urugamosu
Smiles are free, you know~
Community Supporter
 
Join Date: Sep 2008
Location: Perth, Australia
Age: 19
Gender: Male
Nature: Gentle
---------------------------
Pokemon Essentials
---------------------------
Exception: Errno::EACCES

Message: Permission denied - Data/move2anim.dat

Compiler:3869:in `save_data'

Compiler:3869:in `pbCompileAnimations'

Compiler:3930:in `pbCompileAllData'

Compiler:4027



How do you fix this?
__________________

Adventures, are sometimes even the simplest things.
ProfileYouTubeRedditPokeCommunityBlog
Reply With Quote
  #14    
Old December 4th, 2010, 12:44 PM
Big Bang
Creator Of Pokémon Solstice
 
Join Date: Nov 2010
Location: Not avaliable.
-----------------
I need some help. -Pokemon Essentials
-----------------

Okay, I want to transfer my player to the starting town. I have applied the Transfer command in the Intro Event, and in the first town, with the same Transfer command in the town. However, Idid place a starting point where the event should have made it so you start there. But, if I open the game(not in RPG Maker XP) it shows the Fameguru words & stuff, then title screen, then you choose your option. If you click NEW GAME, it plays the town's music instead of the intro's music, and it shows up as a black screen with a prompt that comes up saying exactly this:

Script 'PokemonUtilities' line 289: NoMethodError occurred
undefined method ` +' for nil:NilClass
__________________
Not avaliable.
Reply With Quote
  #15    
Old December 4th, 2010, 02:10 PM
DAWJ
Beginning Trainer
 
Join Date: Jul 2010
Location: New York
Gender: Male
Nature: Lonely
Quote:
Originally Posted by Big Bang View Post
-----------------
I need some help. -Pokemon Essentials
-----------------

Okay, I want to transfer my player to the starting town. I have applied the Transfer command in the Intro Event, and in the first town, with the same Transfer command in the town. However, Idid place a starting point where the event should have made it so you start there. But, if I open the game(not in RPG Maker XP) it shows the Fameguru words & stuff, then title screen, then you choose your option. If you click NEW GAME, it plays the town's music instead of the intro's music, and it shows up as a black screen with a prompt that comes up saying exactly this:

Script 'PokemonUtilities' line 289: NoMethodError occurred
undefined method ` +' for nil:NilClass
You would get better help by posting this in the pokemon essentials thread(Home page, click game development, then click Pokemon Essentials: Starter kit for RPG maker XP
Reply With Quote
  #16    
Old December 4th, 2010, 02:49 PM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
Wow, why are people posting errors of essentials in my thread and also breaking the rule of posting in a thread over the allowed time of it being inactive :/. Just confuses me how no one reads TUTORIAL thread :L. But oh well that's new people for ya. (not being biased as there are some clever ones out there(who read))
__________________

Pokémon: Lost Souls.







Developed by Carmaniac.
Reply With Quote
  #17    
Old May 24th, 2012, 03:02 PM
Felphor
Beginning Trainer
 
Join Date: Dec 2010
Gender: Male
hi, i was wondering if anyone could help me with a scripting problem. im trying to create special npc's like in the old games that...
1) Demonstrate how to catch a pokemon.
2) Have you follow them while they explain the Pc, pokemart and that kinda stuff.
Reply With Quote
  #18    
Old June 8th, 2012, 05:09 AM
abnegation's Avatar
abnegation
adventure
Community Supporter
 
Join Date: Apr 2009
Age: 21
Surprised I didn't see this revival. Do not revive threads over two months old. Thanks.

Locked.
Reply With Quote
  #19    
Old October 30th, 2013, 07:10 AM
linkthehero's Avatar
linkthehero
 
Join Date: Sep 2012
Gender: Male
hmmmmm the problem is the mouse script don't work =(
Reply With Quote
  #20    
Old October 30th, 2013, 07:43 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
I'm not surprised. None of the scripts have been updated in years, and you're supposed to do thing by yourself in order to add the functionality anyway.

Please do a reality check before posting in really old threads.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 10:57 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.