Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [VX/XP] clickable events mini-game
Tsukihime
post Sep 30 2011, 06:12 PM
Post #1


Level 25
Group Icon

Group: Revolutionary
Posts: 561
Type: None
RM Skill: Undisclosed
Rev Points: 25




Was collecting scripts and came across Glitchfinder's keyboard and mouse input systems.

Difficulty: easy
Engines: XP, VX
Scripts required: Keyboard Input, Mouse input.
Switches: none
Variables: none
Common events: none

Note that these values are based on a minimalistic design.
If you're making a mini-game that is contained in a single map, consider using map variables. That way, you can copy it into another project and not have to worry about variable conflicts.

Concept:

There's an event on the map. When you click on the event, something will happen.
It's a very general idea with plenty of applications.

The key idea behind these events is to use the following script in a conditional branch:

CODE
Mouse.press?(1) and Mouse.tile_pos == [$game_map.events[@event_id].x, $game_map.events[@event_id].y]


That just means when you click the left button on the event (specifically, it checks whether the position of your cursor is the same as the position of the event). I'm not sure if there's an easier way to get the x,y position of an event.

If it's true, you would just fill in what's supposed to happen when you click on the event successfully.
Additionally, you can separate it into nested conditional branches if you want to specify what happens if you miss the target.

CODE
Conditional Branch: Script: Mouse.press?(1)
   Conditional Branch: Script: Mouse.tile_pos == [$game_map.events[@event_id].x, $game_map.events[@event_id].y]
      <what happens when you click on it>
      else
         <what happens when you miss it>
      branch end
   else
      <leave this empty, otherwise it'll always run since you probably aren't clicking your mouse>
   branch end


Examples:

When you click on the event, you receive 1000 gold. If you miss, you exit the map.


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
Redd
post Oct 1 2011, 07:13 AM
Post #2


:<
Group Icon

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




Would you mind making a demo for us to test out? What makes this different than just common knowledge about Glitchfinder's inputs? The instructions for it are right inside of the script.


__________________________
Go to the top of the page
 
+Quote Post
   
Tsukihime
post Oct 1 2011, 08:37 AM
Post #3


Level 25
Group Icon

Group: Revolutionary
Posts: 561
Type: None
RM Skill: Undisclosed
Rev Points: 25




There should be no difference, as scripted conditions as well as attributes for each class in the default system should be common knowledge to anyone that's making events anyways.

I am simply amusing myself with the discovery of scripts, class attributes, and removing dependencies on global switches and variables.

This post has been edited by Tsukihime: Oct 1 2011, 08:43 AM


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   

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: 23rd May 2013 - 01:25 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker