Tomo2000 60 Report post Posted March 26, 2009 I'd like to request a simple script for a game I am making. All I would like it to do is to is change the actor graphics to the bat image and turn switch 1 on when you press the keyboard 'A'. Then when you press 'A' again, it will turn the switch off and change the graphics back to normal. Would somebody be able to make it for me? -Thanks in Advance, Tomo2000. ;) Share this post Link to post Share on other sites
Leon 55 Report post Posted March 26, 2009 Believe it or not, all you need to know is a couple script commands, and you can make this in a common event. (Which is really easier than editing Scene_Map. It won't interrupt the other scripts that edite Scene_Map). Now, let's get started. To do this, you need a switch to turn on the common event; and set it to 'parallel process'. After that, do this: Conditional Branch, tab 4, the Script command. (Yes, conditional branch). In there, put this: Input.trigger?(Input::Z) , no 'else' case. Conditional Branch, tab 4, the Script command (again). This time, insert this: $game_party.actors[0].character_name == "088-Monster02" Yes, there is an else command. Next, set an animation, if you want it, over the 'player'.(Show animation command.) Change Actor Graphic event command. Change the main actor's graphic to the actor's human form. Turn on your switch. Now, under the 'else' command, set your animation again, if you want it. (Show animation command.) Set the 'Change Graphic' command so it will change the main actor into a bat. Turn your switch off. Not too hard. Here is a picture of how it should look when complete: Share this post Link to post Share on other sites
Kiriashi 117 Report post Posted March 26, 2009 Haha, sweet; I think I could do this. Really easy huh? Tomo2000, if your problem has been solved, edit the name of your topic (this one) the following: [XP/Solved] Thank you! Share this post Link to post Share on other sites
Polraudio 122 Report post Posted March 26, 2009 I was going to suggest the same thing but you beat me. Added [XP/Solved] to title. Share this post Link to post Share on other sites
Leon 55 Report post Posted March 26, 2009 You guys are jumping the gun iwth the 'solved'. Remember: It isn't solved until he is satisfied, and we won't know that til he posts again Share this post Link to post Share on other sites
Kiriashi 117 Report post Posted March 26, 2009 Yeah, I was juts asking, xD! If he IS solved, then that is when I was telling him to do that. Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 26, 2009 Wow, thanks Leon! I really appreciate it and never thought I would be able to use a common event. I'll be sure to credit you when my game is complete! Im having a little bit of trouble though... I have copied everything to your exact specifications and made it so that the map will turn on switch 2 on entering, but when I press 'A' nothing happens. Yes, I did change it from 'Z' to 'A'. Also, I think you may have made a mistake. Shouldn't it be : $game_party.actors[0].character_graphic == "088-Monster02" Instead of: $game_party.actors[0].character_name == "088-Monster02" Because I'm not 100% sure why it says 'character_name'. Please clarify this for me. EDIT: Incase you are wondering, this is what my common event looks like. I only have 1 common event. -Thanks in Advance, Tomo2000 Share this post Link to post Share on other sites
Leon 55 Report post Posted March 27, 2009 It should be character_name, because that is the variable where the name of the graphic for the actor. You see, the way scripting works is the term 'actor' is for everything a character is. Their name, graphic, class, etc. Character defines the picture for the actor. That is why you are probably confused. So '$game_party.' defines the overall party. 'actors' defines the array that holds the actors of the party. '[0]' defines it is calling up the first actor in the array. After that, you have 'character_name' defines the actor's sprite graphic. In essence, this takes the first actor in the party, and changes their graphic. I hope that clarifies how this works. Also, the reason i set it to 'Z', is because 'Z' is the name of the button, and the 'A' key accesses the 'Z' button. Here, this should explain more. It is directly from the Help File Share this post Link to post Share on other sites
Nisage 31 Report post Posted March 27, 2009 You could also Playtest your game and press F1. A window called Game Properties will appear and it'll have 3 tabs, no idea what the first tab is really about, but the second and third one are called Gamepad and Keyboard, showing you which button does what. But Leons way works to. Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 28, 2009 Ok, I've set up everything in the common event as Leon has (no difference) and also made an autorun event on the map to turn the switch in the parallel process on. Is this right? And is there anything specific apart from the common event that I need to do to make the event work? Share this post Link to post Share on other sites
Leon 55 Report post Posted March 29, 2009 Nope, should work fine. Just turn on the switch to make this run via parallel process, and make sure you have the right key set up for hte button you wish to use. Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 29, 2009 Im sorry... I've tried everything I can think of (and copied it to Leon's exact spec's) but it still wont work. Leon, if you dont mind, would you be able to make me a demo of it? -Thanks in advance, Tomo2000 Share this post Link to post Share on other sites
Leon 55 Report post Posted March 30, 2009 Post a screenshot of it real quick, and I can tell you if there is a problem or not. Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 30, 2009 Ok, sure, this is the Common Event: Common Event And this is the autorun event: Autorun Event I only have two switches; Bat Transform and Allow Bat. Anything else I need? Share this post Link to post Share on other sites
Leon 55 Report post Posted March 30, 2009 Ok, sure, this is the Common Event: Common Event And this is the autorun event: Autorun Event I only have two switches; Bat Transform and Allow Bat. Anything else I need? In the second conditional branch, does it say: $game_party.actors[0].character_name == "094-Monster08" Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 30, 2009 No, it says $game_party.actors[0].character_name == "088-Monster02" Share this post Link to post Share on other sites
Leon 55 Report post Posted March 30, 2009 It needs to say: $game_party.actors[0].character_name == "094-Monster08" Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 30, 2009 Will it need anything special in the line of script if it has a hue? I've replaced the script and still nothing... Share this post Link to post Share on other sites
Leon 55 Report post Posted March 30, 2009 Here is a demo of it using Arshes. http://www.2shared.com/file/5211140/d46a50...o_for_Tomo.html Share this post Link to post Share on other sites
Tomo2000 60 Report post Posted March 30, 2009 Amazing! Thats exactly how I wanted it! I also tested it on my other game and now its working! Thanks a million, Leon! This topic is now solved! By the way, I finished you down image, it will be posted in your thread. Share this post Link to post Share on other sites