How to make a wall damage you.

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
I know what damage floors are, but in my game I have these thorny thickets that you're not supposed to be able to walk ON. I was wondering if it was possible to make it so that a wall hurt you if you walked into it.
 
Last edited by a moderator:

Lustermx

Veteran
Veteran
Joined
Mar 17, 2012
Messages
252
Reaction score
147
Primarily Uses
I guess this could be done with an event with the settings: Event touch and Same as characters
 

AlphaSilvr

King of the Wolves
Veteran
Joined
Aug 7, 2013
Messages
63
Reaction score
8
First Language
English
Primarily Uses
If there aren't a lot of walls that do this you can make an event that is set to "Same as Characters" and "Player Touch" that has a Change HP: Entire Party, -X
 

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
Yay, it works, thank you!
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
I know what damage floors are, but in my game I have these thorny thickets that you're not supposed to be able to walk ON. I was wondering if it was possible to make it so that a wall hurt you if you walked into it.
If you have too many of these thorny thicket walls for touch events to be a reasonable solution you could create a parallel process event that keeps track of your player's coordinates and damages the player that way.  In case you want to try it, here is how you would go about doing it.

Create a common event and set the trigger to Parallel Process.  Make a condition switch for it and turn it on at the beginning of the game so the event will start processing.

Then make 3 variables and call them something like [Player:X], [Player:Y], and [Player:Direction].  Then mirror these variables to the Game Data using the control variables command in your common event.  Like this:

Control Variables: [Player:X] = Player's Map X

Control Variables: [Player:Y] = Player's Map Y

Control Variables: Player:Direction] = Player's Direction

This will keep track where the player is and what direction they are facing at all times while they are on your map.  You can then use this data to write conditional branches into your common event that trigger event commands over a wide area.  For example:

Let's say you have a 6 tile wide Thorny Thicket Wall on the southern edge of your map that you want to damage the player if they walk into it.  Go to your map and get the X,Y coordinates for each tile in front of your wall.  For the sake of this example let's say the coordinates are 17,20 - 18,20 - 19,20 - 20,20 - 21,20 - 22,20.  Once you have this information you can create a series of conditional branches like this:

Conditional Branch: Player is Facing Down

Conditional Branch: Variable [Player:X] >= 17

Conditional Branch: Variable [Player:X] <= 22

Conditional Branch: Variable [Player:Y] == 20 

Change HP: Entire Party, - 1

Flash Screen: 255, 255, 255, 255, @60

Play SE: 'Absorb1', 80, 100

Set Move Route: Player(Wait)

                            $> Move Up

                            $> Turn Down

Branch End

Branch End

Branch End

Branch End

This would cause the party to lose 1 HP and the player to move backward as if he got knocked back by damage every time they walk toward your Thorny Thickets. 
 
Last edited by a moderator:

SkyAce

Game Creator
Member
Joined
Aug 23, 2013
Messages
7
Reaction score
0
First Language
English
Primarily Uses
You can also easy and fastly go at the database and then click at tileset and then at

Damaged floor at the left and then you only choose a brick that you maker a new tileset

graphics and then you got it ! You save it at A , B , C , D , E ... And then when you will

click on ... This will work surely ! When touch on ... It may work ...

It 100 % Work for me !

Yay !

Hope that help yourself bro!. :D
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I think in the sense that if you have a large number of events it can cause lag.

I think the best solution is the one suggested by SkyAce, i.e. have one tile that you use to make the bush (it can be identical to an ordinary one) which you set to terrain damage in the tileset tab of the data base.  That way you don't need any events at all.  You just have to remember not to use that tile anywhere else.
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
Wait, you can have "too many"...?
The maker can't handle but so many events at once or it starts to lag really bad.  It's hard to give an exact number but it's a good idea to keep them as limited as possible.  I found this out the hard way when I had over 100 events at once and the lag was so bad it made me re-design my game.

The way I showed you is the best way I know how to make one event command cover many tiles.  That way you don't have to create a single event for each tile you want to trigger something.
 
Last edited by a moderator:

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
The maker can't handle but so many events at once or it starts to lag really bad.  It's hard to give an exact number but it's a good idea to keep them as limited as possible.  I found this out the hard way when I had over 100 events at once and the lag was so bad it made me re-design my game.

The way I showed you is the best way I know how to make one event command cover many tiles.  That way you don't have to create a single event for each tile you want to trigger something.
Your method is really confusing to me... it would definitely be helpful, because in one stage of my game all of the borders, plus obstacles, are those thorns.

But it's all pretty gibberish to me and I'd need someone to walk me through it... I have something called TeamViewer if you wouldn't mind helping.
 

Samurai T

Villager
Member
Joined
Jul 23, 2013
Messages
7
Reaction score
1
First Language
English
Primarily Uses
Koi,

Another alternative is to put a moving event on top of your thorn bushes and have it set to go off if the player triggers it. Set movement to custom and have it move toward player, skip if can't move. Set the speed to x4 faster and frequency highest so that the event can keep up with the player walking around it. When the player runs into the wandering event, it gets fired off and does damage or whatever.

The trick is in constraining the event. What I did was use Yanfly's Restrict Region script

http://yanflychannel.wordpress.com/rmvxa/field-scripts/move-restrict-region/

and I painted around the obstacle so my event wouldn't wander off. If for some reason you need to make your terrain so the event can walk on it, you can always use the move restrict region to keep the player off of it.

The cool thing about this approach is that then you can have all kinds of winding mazes with a couple of events covering them. Maybe.
 

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
Koi,

Another alternative is to put a moving event on top of your thorn bushes and have it set to go off if the player triggers it. Set movement to custom and have it move toward player, skip if can't move. Set the speed to x4 faster and frequency highest so that the event can keep up with the player walking around it. When the player runs into the wandering event, it gets fired off and does damage or whatever.

The trick is in constraining the event. What I did was use Yanfly's Restrict Region script

http://yanflychannel.wordpress.com/rmvxa/field-scripts/move-restrict-region/

and I painted around the obstacle so my event wouldn't wander off. If for some reason you need to make your terrain so the event can walk on it, you can always use the move restrict region to keep the player off of it.

The cool thing about this approach is that then you can have all kinds of winding mazes with a couple of events covering them. Maybe.
Hmm. I could definitely use this!

However, it says "<npc restrict>"

How do I tell the game which event to restrict?
 

Samurai T

Villager
Member
Joined
Jul 23, 2013
Messages
7
Reaction score
1
First Language
English
Primarily Uses
The real answer to that would be to mod the script so that it would accept one or more event IDs as attributes. However, I'm terrified by Yanfly's dire warnings (not to mention I don't know enough Ruby to do it yet and submit for consideration to the original author) so I tried the following instead of my first suggestion.

1. I used an auto-tile and put an event on top of it. Events can move freely on top and can't get off, except the bottom -- I'm not smart enough to know why;

2. Put a tile below the ends of your thorny barrier that allow movement from a tile on top but not below. This allows your wandering event to get next to you, but not escape off the auto-tile;

and/or

Create a complete set of thorny bushes with directional arrows that keep your event on top of it. (Think of the examples at the bottom of the default exterior tile set.)

It sounds like this is a big enough part of your game that it might be worth the extra tiles you'd have to set aside in a tile set and possible confusion when creating the map to do it this way. And then you can have events wandering around the paths as well, and save the regions for other things -- or do both together depending?

And maybe one of the might script gods will swoop over this topic and grace us with an enhancement to the Yanfly script and give us more options to choose from.  ;-)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
That script looks like it just stops events from going "out of bounds", when the bounds are defined by an outline using region ids.


Here's a Region Common Events script I whipped up. It's very basic, but it should let you take care of your damage from walls and splash sound effects without having to use events.


One issue might be that it just looks at what's in front of you - you don't actually have to try to walk into it. So if you walk up to a wall but don't actually push the arrow to try and walk into it, the common event would still run. You MAY be able to get around that by adding a conditional branch to see if the up arrow is pressed to your common event.
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
Your method is really confusing to me... it would definitely be helpful, because in one stage of my game all of the borders, plus obstacles, are those thorns.

But it's all pretty gibberish to me and I'd need someone to walk me through it... I have something called TeamViewer if you wouldn't mind helping.
Sorry I tried to explain it as well as I could.  I'm not sure what TeamViewer is, but I don't mind walking you through it.  It looks a lot more complicated than it is.
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top