Event system for running/dashing not working

Status
Not open for further replies.

jabberwockyx

Villager
Member
Joined
May 22, 2014
Messages
21
Reaction score
0
Primarily Uses
Sorry for continuing to be obnoxious and asking questions in this forum, but I'm trying to implement a system that's just not working. I've made two separate charsets for my main player, one that's a normal walking sprite sheet, and one with sprites that make it look like the person is actually running instead of just speedwalking. I'm trying to set up an event system for my map (I think there might be scripts that do the same thing, but I'd rather use a parallel process event system on each map because there are some maps where I don't want the character to be able to run) where when the player presses shift, they're able to run. I thought it would be simple, just set up a conditional branch where when the player is pressing shift (button A, right?), their speed is increased and the actor graphic is changed to the running version of their sprite. I set my event, but lo and behold, nothing happens when I press shift in game. I've attached the event here... Can anyone tell me what I'm doing wrong?

EDIT: Just realized that for some reason, there are two pages in this event -- I've changed that so there's just the one event page and no additional ones, but it's still not working.

Untitled-1.png
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What does "not working" mean? Does the sprite change when they run? Is the problem that it doesn't change back again?

Is that the actor in your party, and are they the leader?

I would do this:

Conditional Branch: Button (for running) is pressed Change Sprite to running spriteElse Change Sprite to walking spriteEndWait 4 framesThe wait is so you don't suck the life out of your CPU by checking 60 times a second.I don't have the engine in front of me, so I can't verify that Button A is the shift button.
 
Last edited by a moderator:

jabberwockyx

Villager
Member
Joined
May 22, 2014
Messages
21
Reaction score
0
Primarily Uses
I said what 'not working' means: "I set my event, but lo and behold, nothing happens when I press shift in game." It's literally just that, it acts like nothing's happened at all, I don't  change speed nor does the graphic change. And yes, that's the actor in my party, and there's only one player, so they're the leader! I just gave that a shot too, but it's also not doing anything... it's like the event's not even running, but it's clearly a parallel process, and I'm using a blank test map with no other events, so I have no idea what the problem is. It is very frustrating. I think I'm gonna call it a night and get some sleep, and maybe tomorrow I'll try making a new project with the exact same event and see if nothing happens there too...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
zip up your project and load it up somewhere. I'll take a look


I really don't see any reason why it wouldn't work.


You could try just adding a Show Message command in there to determine whether it's actually recognizing the keypress or not.
 
Last edited by a moderator:

jabberwockyx

Villager
Member
Joined
May 22, 2014
Messages
21
Reaction score
0
Primarily Uses
I'm an idiot, I had my start square on the wrong map -- that's what I get for using blank maps to test things, sheesh. Lesson learned! If it's okay to ask another question in this thread, I'm having another related issue. I've expanded this so that the player runs when Button A is being pressed (if their stamina is above a certain level), and walks the rest of the time. I wanted to make it so that after 5 seconds of standing still without moving, the idle animation begins. I've gotten this so it works, but when I press one of the arrow keys to continue walking or running, the idle animation continues for another 5 seconds before switching to the regular walking/running sprites. I want the sprite to immediately switch back to walking/running as soon as you press an arrow key and/or shift. Because it looks kind of ridiculous if you're gliding across a map facing forward and tapping your foot. This is what my (long and probably overly complicated) event system looks like for that:

Event1.png

Event2.png

Event3.png

Event4.png

Event5.png
 

neiljwd

Villager
Member
Joined
Nov 11, 2013
Messages
10
Reaction score
0
First Language
English
Primarily Uses
I know you don't want a script... but I really think you do :p

It can do everything you want, without the need for complex eventing on every map.

Can control the current amount of run points in a script call from an event

$game_player.max_run_points = 0That would allow you to set there current  max run points to zero, so they can't run, just store the previous amount after.

$game_player.run_points = 0Alternatively have that run as a parallel process on a map and that will set their CURRENT run points to 0, so they can't run, without their maximum being altered.

Even has and _dash and _idle call for running/idle graphics... speaking of which if I use it in additon to a mouse control script, it also gets the weird floaty movement coming out of idle... just thought I'd mention it.

Anyhoo, I know you didn't want a script, but I can't help directly, just offering it out as a possibility.

# Written by Synthesize# Version 2.70# January 26, 2008 (v1)# Revised: March 1, 2008 (v2)# Revised: September 4, 2010 (v2.5)# Revised: 8 May, 2012 (2.6, NREdit)# Revised: 15 Nov, 2013 (2.7, NREdit)#===============================================================================# Customization#-------------------------------------------------------------------------------module StandWalkRun Use_run = true # Use Run Points? Use_run_sprite = true# Use a Running sprite? Run_speed = 5 # Player speed while running Walk_speed = 4 # Player speed while walking Run_sprite_suffix = '_dash' # Running Sprite Suffix Run_points = 100 # The maximum amount of Run Points Run_points_restore = 20 # 1 Run Point is restored in X Frames Restore_run_while_walking = true # Restore points while walking? Use_idle_sprite = false # Use Idle Sprite? Idle_sprite_suffix = '_idle' # idle Sprite Suffix Use_anime = true # Animate your Idle Sprite? Idle_time = 40 # Time before sprite is animatedend#-------------------------------------------------------------------------------# Scene_Map:: The main functions of the script are here#-------------------------------------------------------------------------------class Scene_Map # Aliases alias syn_map_update update #----------------------------------------------------------------------------- # Initiate variables #----------------------------------------------------------------------------- def initialize if $game_player.old_character_name == nil $game_player.old_character_name = $game_player.character_name end @wait_time = 0 @wait_time2 = 0 end #----------------------------------------------------------------------------- # Update:: Update the scene #----------------------------------------------------------------------------- def update syn_map_update if Input.dir4 == 0 wait(1, false) if StandWalkRun::Use_idle_sprite if $game_player.move_route_forcing == false call_idle($game_player.character_name + StandWalkRun::Idle_sprite_suffix, StandWalkRun::Use_anime) if @wait_time == StandWalkRun::Idle_time $game_temp.syn_state = "idle" end restore_run if StandWalkRun::Use_run else $game_temp.syn_state = "" restore_run if StandWalkRun::Restore_run_while_walking call_idle($game_player.old_character_name, false) if $game_player.character_name != $game_player.old_character_name @wait_time = 0 end if $game_temp.sprite_changed == true $game_player.old_character_name = $game_player.character_name $game_temp.sprite_changed = false end end #----------------------------------------------------------------------------- # Call_Idle:: Sets and animates the idle Sprite #----------------------------------------------------------------------------- def call_idle(sprite, anime) $game_player.set_step_anime(anime) $game_player.set_graphic(sprite) end #----------------------------------------------------------------------------- # Restore_Run: Restore Run Points #----------------------------------------------------------------------------- def restore_run if $game_player.run_points < $game_player.max_run_points wait(1, true) $game_player.run_points += 1 if @wait_time2 == StandWalkRun::Run_points_restore @wait_time2 = 0 if @wait_time2 == StandWalkRun::Run_points_restore end end #----------------------------------------------------------------------------- # Wait:: Allows Wait Times #----------------------------------------------------------------------------- def wait(duration, value) for i in 0...duration @wait_time += 1 if value == false @wait_time2 += 1 if value break if i >= duration / 2 end endend #-------------------------------------------------------------------------------# Game_Temp:: Create current state#-------------------------------------------------------------------------------class Game_Temp attr_accessor :syn_state attr_accessor :sprite_changed alias syn_temp_init initialize def initialize @syn_state = "" @sprite_changed = false syn_temp_init endend#-------------------------------------------------------------------------------# Game_Character:: Create the Change_Sprite method#-------------------------------------------------------------------------------class Game_Character # Attr(s) attr_accessor :old_character_name attr_accessor :run_points attr_accessor :max_run_points alias syn_ch_init initialize #----------------------------------------------------------------------------- # Initialize Variables #----------------------------------------------------------------------------- def initialize @run_points = StandWalkRun::Run_points @max_run_points = @run_points syn_ch_init end #----------------------------------------------------------------------------- # Set Setp Animation #----------------------------------------------------------------------------- def set_step_anime(value) @step_anime = value return @step_anime endend#-------------------------------------------------------------------------------# Game_Player:: This handles the dash process#-------------------------------------------------------------------------------class Game_Player < Game_Character alias syn_player_initialize initialize alias syn_player_update update alias syn_player_refresh refresh alias syn_player_move_type_custom move_type_custom def initialize(*args, &blk) ret_val = syn_player_initialize(*args, &blk) set_walk_speed(StandWalkRun::Walk_speed) set_run_speed(StandWalkRun::Run_speed) end def dash? return false if @run_points == 0 and StandWalkRun::Use_run return true if Input.press?(Input::A) end def refresh syn_player_refresh self.old_character_name = @character_name end def set_run_speed(val) @ty_RunWalk_run_speed = [[@ty_RunWalk_walk_speed + 1, val.to_i].max, 7].min end def set_walk_speed(val) @ty_RunWalk_walk_speed = [[val.to_i, 1].max, 6].min set_run_speed(val + 1) end #----------------------------------------------------------------------------- # Update:: Update the scene #---------------------------------------------------------------------------- def update if dash? if Input.dir4 == 0 $game_player.set_graphic($game_player.old_character_name) end unless $game_temp.syn_state == "idle" if StandWalkRun::Use_run_sprite set_graphic(@character_name + StandWalkRun::Run_sprite_suffix) end @move_speed = @ty_RunWalk_run_speed @run_points -= 1 syn_player_update end else @move_speed = @ty_RunWalk_walk_speed syn_player_update end end def set_graphic(character_name) @tile_id = 0 @character_name = character_name end #-------------------------------------------------------------------------- # * Move Type : Custom #-------------------------------------------------------------------------- def move_type_custom old_ch_name = @character_name syn_player_move_type_custom if old_ch_name != @character_name # Change Graphic self.old_character_name = @character_name end endend#-------------------------------------------------------------------------------# * This script is not compatible with RPG Maker XP * YES IT IS LOL#-------------------------------------------------------------------------------# Written by Synthesize# Version 2.7# Requested by Cerulean SkyThat's a custon modification (by Night Runner) of an original script. So have a look through before implementation. Like line 20, I have idle animation off.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No, it's not okay to ask another question in the same thread. Once an issue has been resolved, the thread gets locked. If you need further help, just start a new thread.


@neiljwd, when providing scripts, JUST give a link to it. Don't copy and paste the whole thing into the thread. There are a number of reasons for this. If you CAN'T link to it and NEED to put it in the thread, at least put it all in spoiler tags.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top