DartKain 1 Posted April 8, 2012 Very good, but have some problem. On teleporting hero with event: Script 'CSCA DT' line 535: NoMethodError occurred. undefined method 'moveto' for nil:NilClass Share this post Link to post Share on other sites
casper667 131 Posted April 8, 2012 (edited) @DartKain I found the problem and the script is now updated in main post. Sorry about that! @Tobyej Script has been updated and your error should be fixed now Edited April 8, 2012 by casper667 Share this post Link to post Share on other sites
SirCumferance 28 Posted April 8, 2012 okay. found the problem.. i guess i have to redo the whole map to give the event right id x.x What I ended up doing was copy/paste the first event, then delete the first event and then make another blank event, it becomes Event 1. Share this post Link to post Share on other sites
GoldenT 0 Posted April 9, 2012 Could I please get some help? I did everything I can think of... I think, but when I try to shoot an arrow, I get the error message for row 499 in the script. What am I doing wrong? NoMethod Error occured. Undefined method "moveto" for nil:NilClass. I suppose it´s easier than I think, but I can´t really find the solution. Share this post Link to post Share on other sites
casper667 131 Posted April 9, 2012 @GoldenT It sounds like you have an outdated version of the script, as I don't think this bug should be present anymore and when I looked through the script line 499 doesn't have anything to do with the method moveto anymore. What version of the script are you using? It should say in near the top. The demo still has the outdated version(version 1.1) of the script, you'll need to get the updated version from the text file link. Share this post Link to post Share on other sites
GoldenT 0 Posted April 9, 2012 (edited) Ah. That solves everything. I said it probably would be easier than I thought You probably should update the one in the demo as well then. Anyway, really wonderful script. ^^ Really good work. EDIT: Ehm... I get the same error from the script posted on this board, but this time it´s line 509. The problem still exists. Probably wrong on my side again. Edited April 9, 2012 by GoldenT Share this post Link to post Share on other sites
casper667 131 Posted April 9, 2012 I plan on updating the demo, I just haven't gotten around to updating it yet Also...I can't seem to reproduce your error. Does this happen on every map or just one? Are you using any other scripts? How are your Dungeon Tool events set up? Does this happen with the Bomb as well? Share this post Link to post Share on other sites
GoldenT 0 Posted April 9, 2012 (edited) The same thing happens with the bomb, except it´s line 456. @csca_bomb_event.moveto($game_player.x, $game_player.y) I have a real strong feeling the fault is at my side here Something about the movement. I am far from skilled in scripting to be honest and this is nothing I believe I can figure out by myself. EDIT: It doesn´t work when you´re on another map either. I guess I should take a closer look at my Dungeon Tool events... somehow. ^^ EDIT 2: I found the solution. Stupid as I were... I had forgotten to put in the Dungeon_Tool event >__< Sorry for the trouble. I have another problem with the bomb though. I can release the bomb and it vanishes after a few steps, but no animation or explosion even though the files are there. I suspect it´s another matter I have to look closer at. Sorry once again ^^ Edited April 9, 2012 by GoldenT Share this post Link to post Share on other sites
casper667 131 Posted April 9, 2012 (edited) Well, I have to go to bed now, but you can try a few things... Try replacing the use_bomb definition(should be near the line with the error) with this one: def use_bomb @tooltype = :bomb csca_get_bomb_event if @csca_bomb_event != nil @csca_bomb_event.moveto($game_player.x, $game_player.y) @csca_bomb_event.csca_change_graphic(@csca_bomb_event, 2) Audio.se_play("Audio/SE/" + BOMB_PLACEMENT_SOUND, 80, 100) if BOMB_SOUND1 @bombplanted = true @bombsteps = $game_party.steps end end Then try the bomb again and let me know what happens. I'll do some more testing tomorrow as I think I know the cause of it but not entirely sure. EDIT: About your bomb problem... it looks for an animation with an ID of 111 and plays that by default. You'll need to either change the animation ID it uses through the setup portion of the script in the beginning to a valid animation if there are no animations with an ID of 111, or create Animation 111 and copy+paste the bomb animation from the demo to that slot. EDIT2: If you have checked the animation is there and it still disappears, check the animation time specified in the script setup module below where the animation id is specified. If this is set too low the animation will cut off(or not show if set to 0) and finish in the upper-left corner of the map. By default it is set up to work correctly with the animation that comes pre-made in the demo. Edited April 9, 2012 by casper667 Share this post Link to post Share on other sites
DartKain 1 Posted April 9, 2012 Hmm...I have problem again (after updating the script). If i pick Arrow, bomb or other and activate it, game crashed: Script 'CSCA DT' line 511: NoMethodError occurred. undefined method 'moveto' for nil:NilClass P.S: Line 511 is "event.moveto($game_player.x, $game_player.y)" Share this post Link to post Share on other sites
casper667 131 Posted April 9, 2012 @DartKain It sounds like you do not have an event set up on the map for either the bomb or for the other tools, as this is the only way I can reproduce this error. This script assumes that if the ON_OFF switch is ON, the map has events that are set up for these dungeon tools. If you do not wish to use these tools in a map, turn ON_OFF switch to OFF. To set up your events, make sure there is a comment in the bomb event with the text BOMB_TOOL (exactly as it appears), and also that there is a comment in the other tool event with the comment DUNGEON_TOOL (exactly as it appears). You'll need these events in every map you intend to use this script in. If you have double checked and still get this error, can you take a screenshot of your events and post them here? Share this post Link to post Share on other sites
GoldenT 0 Posted April 10, 2012 I came up with a solution for my problems. The script works great so far. I only have a question of interest: Is it crucial for the ON_OFF switch to be OFF in the places you don´t have the events? Is it okay to have the switch at ON at all times even though you may not have an event on, say, one map or two? Just asking how important it is to turn off the switch when you don´t need it or if you just can let it be ON ^^ Share this post Link to post Share on other sites
casper667 131 Posted April 11, 2012 I'd say it's pretty important. Leaving it ON in maps not set up may cause crashes if the player tries to use a tool and the script isn't really meant to work with maps not set up to handle these tools. Also allowing the player to reset in a map not meant for resetting can cause a lot of bugs(it resets all self switches to OFF unless told not to through event comment commands, which can ruin a lot of cutscene/town events). Turning the switch OFF also disables the tool select menu from opening, which helps the player recognize when they need to use these tools and when they do not. For cutscene maps where the player can't input anything anyways, you may be able to leave it on for those(But I'd still recommend putting it to OFF just to be safe) Share this post Link to post Share on other sites
SirCumferance 28 Posted April 11, 2012 (edited) Easy enough, enter the dungeon Switch On and Teleport. Leave the dungeon, Switch Off and Teleport. You know...like Karate Kid Edited April 11, 2012 by Juan Alvarado Share this post Link to post Share on other sites
casper667 131 Posted April 27, 2012 (edited) Hey guys, thought I'd bump this thread to let everyone know this script has been updated. Update includes: 2 New features, a bug fix, and more compatibility Enjoy Update 1.3 -Added ability to hold a button down to turn in the direction pressed instead of moving. This is able to be done at all times. -Fixed reset bug -Added ability to require the player has items to use some tools. For example, the player might need an arrow in their inventory to use the arrow tool. -Increased compatibility by aliasing more stuff. Edited April 27, 2012 by casper667 Share this post Link to post Share on other sites
syrus ultima 44 Posted May 22, 2012 I have a complicated event setup on one particular map that uses call scripts like this $game_player.x==12 I am using the 1.3 and I can't figure out why its causing my event on this one map to not work right. I took cut out the dungeon tool script and proceeded to test play my game to see if my event would then work.. It did work. But when I plugged back in the script it started to no work right. How can I make this script work without effecting my event. I am not using any switches in my event that would throw off the script. Share this post Link to post Share on other sites
SirCumferance 28 Posted May 22, 2012 Find the first event, the 001 event. Copy and paste it. Then delete the 001 event and have the copied one replace it. Then, make a 001 event and leave it blank, try that Share this post Link to post Share on other sites
syrus ultima 44 Posted May 22, 2012 I tried that. It does not work either. Share this post Link to post Share on other sites
SirCumferance 28 Posted May 22, 2012 Damn, it solved all my problems. Does it only do it on one particular map? If there is nothing sensitive on it, maybe you could post it so we could take a look at it Share this post Link to post Share on other sites
syrus ultima 44 Posted May 22, 2012 (edited) it only does it on this one map. The switches i am using aren't conflicting with the script, nor is the variables. If i delete the script my event on the map works perfect. its got have to do something with the call scripts $game_player.x I read in the script that it may not be compatible with scripts that alter Game_Map, or Game_Player. I don't even have any events set up on this map to use the dungeon tools. Only thing I have set up is my event. Nothing is wrong with the event. I rather not post a screenshot of my event and I don't want to give away what I am doing Edited May 22, 2012 by syrus ultima Share this post Link to post Share on other sites
SirCumferance 28 Posted May 22, 2012 Ok, no prob, I totally understand. Hmm, then try moving the script above or below the other scripts that affect the Game_Map, or Game_Player. I have often just rearranged the order of scripts and found them fixed Share this post Link to post Share on other sites
casper667 131 Posted May 22, 2012 Do you get an error message or does the event just not activate(if it partially works, where does the event code stop working)? Are you using any other scripts that alter the Game_Player class? How are you using $game_player.x == 12 (conditional branch, script call, other) ? Are you making any other script calls that may cause the script to malfunction? I understand that you may not want to give away what you are doing, but unless there is enough information to reproduce this error it becomes a lot harder to find what is going wrong and thus fix it. From the testing I've done, tracking the player's x and y coordinates seem to work fine with this script. Share this post Link to post Share on other sites
syrus ultima 44 Posted May 22, 2012 (edited) @Juan - I don't understand what you mean. Edited May 22, 2012 by syrus ultima Share this post Link to post Share on other sites
SirCumferance 28 Posted May 22, 2012 The location where the scripts are, you may have... MiniMap Custom Battle Custom Menu Lockpick CSCA Tools Random Spell Effect Monster Book So, you would take the CSCA Tool script, Ctrl X and Ctrl V at the top, test it. Try the bottom, anywhere, until it works. Some scripts are funny this way, so when CSCA looks for $game_player, its been changed by an above script. You place CSCA above that and viola, you good. Try it Share this post Link to post Share on other sites
syrus ultima 44 Posted May 22, 2012 (edited) Do you get an error message or does the event just not activate(if it partially works, where does the event code stop working)? Are you using any other scripts that alter the Game_Player class? How are you using $game_player.x == 12 (conditional branch, script call, other) ? Are you making any other script calls that may cause the script to malfunction? I understand that you may not want to give away what you are doing, but unless there is enough information to reproduce this error it becomes a lot harder to find what is going wrong and thus fix it. From the testing I've done, tracking the player's x and y coordinates seem to work fine with this script. I am using a 3 page event that uses condition branches with script calls. I am using control variables for playerX and PlayerY and one for Map ID. these are the call scripts I am using. 1.$game_player.x==6 2.$game_player.x==12 3.$game_player.x==1 4.$game_player.x==18 The switch ID's that the dungeon tool uses is ID's 7-12 I am not using any of those switch ID's in my event nor are they on the map anywhere. When I run the event it doesn't crash or give an error. It just isn't running like it is supposed to. In that maps properties I have its scroll type set to horizontal because it loops my event. what the script is causing my event to do is not loop the character in the vehicle moves for a little bit using a set move route on repeat and the event just starts over in some places and at other places it just stops. @Juan - the only other script I have in there is a Hud script Edited May 22, 2012 by syrus ultima Share this post Link to post Share on other sites