Common Event that Disallows Player Running

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Hello, how do I make it so when a certain common event is running, the player is unable to run and can only walk?

I have devised a stealth skill and want to make it so the player cannot run while using the stealth skill (which calls a common event).

Thank you.
 

BoluBolu

Veteran
Veteran
Joined
Apr 24, 2014
Messages
452
Reaction score
117
Primarily Uses
I''m afraid you need a script to do that(I don't know if it can be done without scripting).

Right now, what in my mind is changing the map dash setting via script call. Then you can assign the script call from common event. But first paste this short code in new slot script

class Game_Map def disable_dash_now @map.disable_dashing = true end def enable_dash_now @map.disable_dashing = false end end # End of Game_MapThe script call for disable dash is :$game_map.disable_dash_now

and for enable dash is $game_map.enable_dash_now

How you implemented it with your skill, I leave it to you :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Do you know how that would work if you saved your game, exited, then resumed your game after disabling dashing? Would it still be disabled, or would the map have reloaded and the setting overwritten?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Since the map doesn't reload upon loading (unless you modify the loading sequence), unless the game is re-saved using the editor, the value would be kept. At least that's how it should be.


That is assuming the disable is done before saving.
 
Last edited by a moderator:

BoluBolu

Veteran
Veteran
Joined
Apr 24, 2014
Messages
452
Reaction score
117
Primarily Uses
@Shaz
That's why I put this on my first line.
 

Right now, what in my mind is changing the map dash setting via script call.
And I still don't really know the OP's gameplay mechanism.

Does the Stealth skill can be used forever or not, does the game allowing the player to save or not while doing Stealth skill.

But in fact that's not real problem, here's what I mean. The player activate Stealth skill, that means he can't do dashing because the map dashing is disabled. That means the actor is in the status Stealth. Now if the player save his game, then exit, then load his game, again  Does the actor still in Stealth Skill?  Of course, because it also saved too. So that's been expected, player still can't do dashing because when he load the game and the game load the map the dash is disabled and actor in Stealth status. 
 

The real problem is if player changed map while the actor is in Stealth Skill, the new map dash setting is following the default map dash setting, that's why this my last line

How you implemented it with your skill, I leave it to you :)
Perhaps he use it only on specific map, and give handler in every transfer map event, who knows :)
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
@Shaz

That's why I put this on my first line.

And I still don't really know the OP's gameplay mechanism.

Does the Stealth skill can be used forever or not, does the game allowing the player to save or not while doing Stealth skill.

But in fact that's not real problem, here's what I mean. The player activate Stealth skill, that means he can't do dashing because the map dashing is disabled. That means the actor is in the status Stealth. Now if the player save his game, then exit, then load his game, again  Does the actor still in Stealth Skill?  Of course, because it also saved too. So that's been expected, player still can't do dashing because when he load the game and the game load the map the dash is disabled and actor in Stealth status. 

The real problem is if player changed map while the actor is in Stealth Skill, the new map dash setting is following the default map dash setting, that's why this my last line

Perhaps he use it only on specific map, and give handler in every transfer map event, who knows :)
Player may save while stealthed (currently, but this could easily change, it isnt important to me).

The stealth mechanism is for an ABS game. The player uses stealth, which triggers a common event shutting off enemy sensors (wont be able to be attacked), turns the player into a shadow, and after 25 steps are taken, resets back to normal (opacity goes to 255, enemy sensors are re-enabled, etc), I want the trigger of the skill use to also prevent running while the skill is being used (during those 25 steps).

No - this skill would have to work on multiple maps. Is there a way to simply disable the button that allows for running, temporarily?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
If you make the skill add a state to player, you can modify the real_speed method (Game_Player I think) so that it won't take into account dashing if the actor has the state
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
If you make the skill add a state to player, you can modify the real_speed method (Game_Player I think) so that it won't take into account dashing if the actor has the state
Well, I suppose the obvious followup would be how to do that exactly. I know how to make states, but not the modify real_speed_method etc..
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
class Game_Player
def real_move_speed


if $game_actors[id].state?(state_id)


return @move_speed


else


return @move_speed + (dash? ? 1 : 0)


end


end


end

This will disable the consideration of dashing if $game_actors[id] has the state
 
Last edited by a moderator:
  • Like
Reactions: Kes

Halfmoon Media

Illustrator, Eventer, Writer
Veteran
Joined
Aug 17, 2014
Messages
61
Reaction score
9
First Language
English
Primarily Uses
I just tested this in my game, but it's throwing up an error:

"undefined method 'state?' for nil:NilClass"
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
I just tested this in my game, but it's throwing up an error:

"undefined method 'state?' for nil:NilClass"
[From: Engr. Adi]

it should be this actually, I forgot that it needs the value to return...

Code:
class Game_Playerdef real_move_speedif $game_actors[id].state?(state_id)return @move_speedelsereturn @move_speed + (dash? ? 1 : 0)endendend
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I just tested this in my game, but it's throwing up an error:


"undefined method 'state?' for nil:NilClass"
Have you by any chance used [id] without modifying it???


You should change it to the id of the actor that ur using for the check
 
Last edited by a moderator:

Halfmoon Media

Illustrator, Eventer, Writer
Veteran
Joined
Aug 17, 2014
Messages
61
Reaction score
9
First Language
English
Primarily Uses
Yep. Just like you thought, I had only changed the state_id. I can enter the actors in array format, yeah?

EDIT: Just tested it, it did need an actor ID. But it won't let me do array format..... But! This still opens up a range of possibilities, thank you Dymdez for posting the topic!
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
It only checks for a single actor :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
$game_actors[id] is AN actor. Not an array of actors.


If you want to see if ANY actor in the party has a certain state, you'd do something like this:

$game_party.members.any? {|actor| actor.state?(state_id)}replacing state_id with the actual id of the state (no leading zeros).
In battle, that will just look at the first 4 battlers. Outside of battle it'll look at the entire party. If you want it to ALWAYS look at just the first 4 battlers, use $game_party.battle_members instead, and if you want it to ALWAYS look at the whole party, use $game_party.all_members
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top