Setting Pass-ability over water

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
Is there a way to set water passable only by events, but not by the main character?

I know you can set the event to Through ON to pass over it but eventually I'll need to stop it at an obstacle which I can set a switch to change it to Through OFF but then I won't be able to move it back to its original location. So setting Through ON/OFF in the event bar isn't really a solution.

 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
What is to prevent you putting Through back on when you want to return it to it's original position?

Perhaps a screen shot of your event so that we can see exactly what it is you are trying to do might help, because your description is lacking a lot of detail.

Under what circumstances do you want whatever it is to move?

Is this a one-off, or is it repeated?

Those sorts of details would help people understand exactly what it is you want to happen.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
You could give water a specific terrain id and overwrite the passable? method in Game_Event to return true for those tiles (you will still need to check for collision etc).
 

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
Sorry neglected to mention I set the Through ON/OFF in the move route but, continue on. (Setting the pillar as through wont work)

It's kind of like this.

The point of the pillar is that it can move left and right freely over (under character obstacles) such as that body of water. Eventually it'll hit an obstacle(let's say like a tree stump(32x32). The character will be able to move to the left/right(opposite where you started pushing) to push the obstacle back. So basically a repeatable moving back and forward pillar not blocked by water but only by the obstacles I set.

@lavra 

You could give water a specific terrain id and overwrite the passable? method in Game_Event to return true for those tiles (you will still need to check for collision etc).
Yeah not sure how to do that.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
If it's for that event only, you should probably try to do it with events and not scripts, which either change every event in the game or have to perform an additional check that fails for most events (everything except the pillar) and costs you performance. You could have a parallel event check the next tile in front of the pillar, setting Through to OFF, when it will reach your obstacle.
 
Last edited by a moderator:

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
I've tried using an event touch event to detect the pillar over the tile before the obstacle but, I can't seem to get it to work properly.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Event touch triggers when the event touches the player.


There is no trigger for event to event in default Ace, all triggers require the player as part - there are a few scripts add functionality for event-event-triggers.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Sure about that? My maker shows me "Player Touch" and "Event Touch" as trigger options. Haven't actually tried the second one but i expect it to work that way.

/edit: Just tested it with a custom move route event and another one set to "Event Touch". The moving event refuses to move onto the touch event, regardless if it's set to Below, Above or Same Level. Doesn't even matter if i set the event to Through. Funny stuff...The event triggers like usual for the player, though.
 
Last edited by a moderator:

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
@Andar ah I see

I've tried a different approach, with a parallel process checking for both events X,Y and its working but there's some weird bug where right before the pillar's event rolls onto the detecter tile, it would cancel the pillar's animation but it will be on top of the detector tile.

I'm also having trouble turning off the switch right after it leaves the detector tile.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Sure about that? My maker shows me "Player Touch" and "Event Touch" as trigger options. Haven't actually tried the second one but i expect it to work that way.
Yes, absolutely

"Player Touch" works when the player moves on the event

"Event Touch" works when the event moves on the player.

It might be a bit misnamed for those who are new to the engine, but that is how those triggers work - feel free to test that if you want.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Yeah, i tested it...i know the old makers had/have actual Event touch triggers that work like i expected it. Interesting that they removed it.
 

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
Alternatively is there any method to just set water below events(but not characters)? I feel that would be the easiest solution. This event is a major part of my puzzling mechanic, so I can set aside a specific tile/terrain. Unless I'm misunderstanding something 
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Water is just a tile like every other, so it's below events/the player anyway. $game_map.passable? returns false for it, since it's set with a X for passability in the database.

Try adding this script:

class Game_Event < Game_Character      attr_reader :tags      alias :original_map_passable? :map_passable?    alias :original_setup_page :setup_page   def setup_page(new_page)    original_setup_page(new_page)    parse_notetags  end   def parse_notetags    @tags = {}    return if @page.nil?    @page.list.select{|c| [108, 408].include?(c.code)}.each do |c|      c.parameters[0].scan(/<\s*(\w+)\s*(?:\s(.+?))?>/){|m| @tags[m[0]] = m[1]}    end  end      def map_passable?(x, y, d)    original_map_passable?(x, y, d) || @tags["ignore"].to_i == $game_map.terrain_tag(x, y)  end endAnd add the following comment to your event:

<ignore 1>"1" is a placeholder for a terrain tag, that will be ignored by that event when checking for passability. That means, you can give your water tiles the terrain tag 3 and add a comment "<ignore 3>" (notetag) to your event and it will be able to move over those water tiles.

The parse_notetags method actually parses a lot more than that, i use it as a base for a lot of my scripts.
 
Last edited by a moderator:

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
I set the water tile to "1" in the terrain tag and added <ignore 1> to the comments in the pillar event.  

Tested it. But the water is still passable by the character.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
By character you mean the player? That shouldn't be the case if the tile is set to impassable (X) in the database.

I also slightly updated the script above to take into account multiple notetags on the same line, although that shouldn't be relevant here.
 
Last edited by a moderator:

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
Yes I mean the player. I double checked the tile in the database. Set to (X) and Terrain tag 1.

Do I add the script under main? or as any copy paste it below Materials, Above Main.

Heres a copy of my event page. the first notetag is from Quasi's Movement script which allows pixel movement and collision detection.

 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Below Materials, above Main.

I tested it with an event with a fixed Move Route (Type Custom), which could move through a wall just fine, while my player couldn't.

I don't know what qmove is supposed to be, though.
 

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
Just checked. The script is incompatible with the pixel movement script I'm using. Damn.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Ah, yeah, that's to be expected, since those scripts have to implements their own passability and collision checking.
 

Ascension

Veteran
Veteran
Joined
Jul 3, 2013
Messages
58
Reaction score
6
First Language
English
Primarily Uses
I'll ask the writer if theres any special way to implement what I want but thanks for helping.
 

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,575
Latest member
akekaphol101
Top