The RPG Maker Resource Kit

Other Game Creation => Program Troubleshooting => Topic started by: taichi556 on September 09, 2008, 02:57:56 PM

Title: Making events interact...
Post by: taichi556 on September 09, 2008, 02:57:56 PM
...This may not be possible without RGSS if it's possible at all so if I should be asking for a script for this instead please let me know..  But anyway, I want my events to be able to activate other events when they collide with them just as a player can do..  To give you guys a better perspective of what I mean, I'm doing a SRPG where each tile has certain terrain properties that will effect each unit, so it's important that the NPCs can obtain these properties from each terrain block as well..

My idea was that each tile would have an event on it that would hold the properties for it's terrain then when the player or the npc stepped on the block that all the properties could be transferred to them; however, if the NPCs can't interact with other events it will cause a problem..
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 03:06:42 PM
on event touch~

also, you could try looking up how to use terrain tags, and/or tracking event coordinates
Title: Re: Making events interact...
Post by: taichi556 on September 09, 2008, 03:17:34 PM
The event coordinates could probably work out well..  I can't seem to find on event touch though..  The only triggers I have on my list are:

Action Key
Hero Touch
Collision
Auto Start
Parallel Process
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 03:19:12 PM
collision, it determines if something happens when the event hits the hero, instead of the other way around.

for event vs event, you'll have to track map coordinates I think
Title: Re: Making events interact...
Post by: taichi556 on September 09, 2008, 03:24:14 PM
Oh, alright..  That'll be a bit more troublesome, but it shouldn't be too difficult.  Thanks for all your help...
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 03:33:44 PM
you can use variables in events and set them equal to event positions, then use conditional branches to compare the coordinates of multiple events :D

alternatively, you could look into terrain tags and scripting involving them :)
Title: Re: Making events interact...
Post by: modern algebra on September 09, 2008, 03:36:45 PM
You wouldn't even need scripting. You can set a variable to the terrain tag that any given event or player is on and modify the attributes under a conditional branch.
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 03:39:39 PM
Quote from: modern algebra on September 09, 2008, 03:36:45 PM
You wouldn't even need scripting. You can set a variable to the terrain tag that any given event or player is on and modify the attributes under a conditional branch.

I haven't found terrain tag interactions in teh event window, pardon for assuming they didn't exist n_n;;
Title: Re: Making events interact...
Post by: taichi556 on September 09, 2008, 03:44:07 PM
Quote from: modern algebra on September 09, 2008, 03:36:45 PM
You wouldn't even need scripting. You can set a variable to the terrain tag that any given event or player is on and modify the attributes under a conditional branch.

Yea, this is what I had in mind.  I'll probably stick a parallel process event in each map, maybe one for each character..  I haven't completely run the logic through my head yet, but I'll use the parallel processes to constantly check the location of each character and apply the terrain effects accordingly...  This actually will be a lot easier and efficient then what I was originally planning..  Thanks guys..
Title: Re: Making events interact...
Post by: modern algebra on September 09, 2008, 03:47:38 PM
Quote from: NAMKCOR on September 09, 2008, 03:39:39 PM
Quote from: modern algebra on September 09, 2008, 03:36:45 PM
You wouldn't even need scripting. You can set a variable to the terrain tag that any given event or player is on and modify the attributes under a conditional branch.

I haven't found terrain tag interactions in teh event window, pardon for assuming they didn't exist n_n;;

Yeah, it's not in an easy place. It's in Control Variable: Character: Terrain Tag

And @taichi - using terrain tags, you do not need to check location. That Control Variable command will automatically return the terrain tag of the tile that the character is standing on.
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 03:51:03 PM
what about enemy events, modern?
can those be tracked in teh same fashon?
Title: Re: Making events interact...
Post by: taichi556 on September 09, 2008, 04:18:08 PM
Quote from: modern algebra on September 09, 2008, 03:47:38 PM
Quote from: NAMKCOR on September 09, 2008, 03:39:39 PM
Quote from: modern algebra on September 09, 2008, 03:36:45 PM
You wouldn't even need scripting. You can set a variable to the terrain tag that any given event or player is on and modify the attributes under a conditional branch.

I haven't found terrain tag interactions in teh event window, pardon for assuming they didn't exist n_n;;

Yeah, it's not in an easy place. It's in Control Variable: Character: Terrain Tag

And @taichi - using terrain tags, you do not need to check location. That Control Variable command will automatically return the terrain tag of the tile that the character is standing on.

Hm, I think I see how the terrain tags work; however, I don't think it will be as suitable for my usage..  From what I gather, the terrain tag is linked to a specific tile whereas my terrain system even if the character is on grass, it still will have varying properties due to shadows for cover..  I think my aforementioned implementation is going to be easier to use for this...
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 04:53:04 PM
there's shadowed grass ?_?
Title: Re: Making events interact...
Post by: taichi556 on September 09, 2008, 05:01:27 PM
Quote from: NAMKCOR on September 09, 2008, 04:53:04 PM
there's shadowed grass ?_?

No, no..  Well, we are making our own tilesets for our project; however, we are going to have shadows as well which are going to have an effect on the terrain blocks' values..  If the terrain all share the same values for the same tile then using terrain maps won't work for my implementation...
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 05:03:28 PM
are the shadows going to be separate from the grass on the tileset?
Title: Re: Making events interact...
Post by: taichi556 on September 09, 2008, 05:30:16 PM
Quote from: NAMKCOR on September 09, 2008, 05:03:28 PM
are the shadows going to be separate from the grass on the tileset?

Most likely, yes..
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 05:34:17 PM
hmm.....

will a terrain tag on a higher layer override a lower layer's terrain tag I wonder...
Title: Re: Making events interact...
Post by: modern algebra on September 09, 2008, 07:30:04 PM
Yeah NAM, you can set it to events or player. So as long as they are actual events and not just sprites from a script. And yes, terrain tag is taken from the highest layer with a tag.

[spoiler=Code]
  #--------------------------------------------------------------------------
  # * Get Terrain Tag
  #     x          : x-coordinate
  #     y          : y-coordinate
  #--------------------------------------------------------------------------
  def terrain_tag(x, y)
    if @map_id != 0
      for i in [2, 1, 0]
        tile_id = data[x, y, i]
        if tile_id == nil
          return 0
        elsif @terrain_tags[tile_id] > 0
          return @terrain_tags[tile_id]
        end
      end
    end
    return 0
  end
[/spoiler]

That's not for you taichi. Just for NAM if he's interested in the method to get terrain tag.

Anyway, so yeah, if your shadow is it's own tile, you can give it a terrain tag and it will take it. You'll only really encounter problems if (a) you need more than 7 (8?) tags or (b) if you want two identical tiles (as in identical layers too) to have the same tag. Though actually, you could use a transparent tile with unique tag on the 3rd layer if you didn't need the 3rd layer on that tile.

(a) could be solved with a minor script
(b) could be too, but configuration might be a bitch. Both would be annoying actually, but (a) would be by tileset and (b) would be by map
Title: Re: Making events interact...
Post by: tSwitch on September 09, 2008, 07:46:03 PM
ah cool, thanks :D