Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Tile SE's?

OK, so I've been playing around with XP/VX for around 4-6 months now, but there is one thing that feels left out from my projects... So here it is.

Is it possible to make tiles play SE's without having to put event's all over the map that will seriously lag the game? Like, I don't know... A script or something?
I want this type of effect for like grass, you walk in it, you hear the grass rustling. Walk in sand, hear the sand kick back. Walking on marble tiles, here footsteps. You know?

So anyways, is that possible? Also will it lag the game?

Thanks.
~Bwai
 
I'm not sure if this will work, but you could try making a common event that has four conditional branches: if player presses up, down, left, right, play SE. The common event would be called with a parallel process on the map.
 

Jason

Awesome Bro

Yeah I would've said that, make each terrain (Grass, snow, sand etc.) have a different terrain tag, set up a variable according to terrain tag, and have a common event, and inside have it say like;

If player terrain tag = 1
Play SE; (Grass)
End

If player terrain tag = 2
Play SE; (Snow)
End

And so on like that...

Should do the trick.
 
jъГìsт":182htb6p said:
If player terrain tag = 1
Play SE; (Grass)
End

If player terrain tag = 2
Play SE; (Snow)
End
This would cause the sound to loop infinitely even while standing still. Checking whether a key is pressed would be problematic because the player could be moving against the wall (i.e. staying in place) and the sound would still play. You would have to have four variables (Old Player X, Old Player Y, New Player X, New Player Y). The parallel process would make the New Player variables equal to Old Player variables, and New Player Variables would be replaced by the player's X and Y. If Old Player variables and New Player Variables are not equal, use the code in the afformentioned quote.

To make sure it doesn't lag, simply put a Wait command of anywhere from 1-4 frames at the bottom of the Parellel Process.
 

Jason

Awesome Bro

It'd only play the sound once wouldn't it ? o.O

The only way I can see it looping is if you put a Jump to Label after the Play SE so it would keep checking over and over, right ? o.O
 
jъГìsт":3onxmnyg said:
It'd only play the sound once wouldn't it ? o.O

The only way I can see it looping is if you put a Jump to Label after the Play SE so it would keep checking over and over, right ? o.O


:l

It's a parallel process, of course it will "keep checking over and over". If it isn't a parallel process, then, what? The only other feasible way is events on every passable tile of the map. Not only would that cause immense lag, there's going to be issues on where to put your normal events (NPC's, etc.) as well.

Testplay this with different methods using RTP SE's as placeholders. Please?
 
Event if End Event Processing can actually stop a Parallel Process from running rather than just restarting it, killing the Parallel Process would cause the footstep sound to play once correctly and no sound occuring for the rest of the duration of the map.

If you can't be bothered to test your own methods, then please avoid from sharing them.
 

Jason

Awesome Bro

Well the way I saw it, is that if you end event processing, it'd only stop the event on that tile, and once you move onto another tile, it'll still check the terrain tag and play the sound, then stop, and so on o.O

Meh fuck it, I think I'll write a script for this sort of thing, lol, seems like a relatively easy thing to do.
 
Well, here's how I did it long ago to show "Walking in the grass" animation. You'd substitute Play SE for Show Animation:

TerrainTagEvent2.png


This might not be perfect, but the idea is simple enough-- if you're holding still, you aren't pressing a button, so nothing happens.

If you press a button while on that terrain, you're moving, so something happens.

Now, if you try repeatedly to move into a wall and can't, you'll still hear the sound/see the animation, but that's fine with me. If it's not fine with you, you'll want a different technique.
 
@Jbrist: Oh.

I see what you were planning on doing then. This method you suggest is feasible; the issue is immense lag due to having an event on every passable tile, and having to create irritating workarounds to make sure that regular events such as NPC's and the like can stay on the map (i.e. "let's spam the Set Event Location command").

The method I suggested a few posts back should fix the small issue Unka Josh mentioned as well.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top