I'm currently working on a project where a monster is chasing the main character through a labirinth.
I would like to make script (or an event mechanism), if the player pushes a button then automatically drops an object - or an item from his inventory - just front of himself to block the monster's path.
I searched all over the internet, but I didn't found anything, which would be useful to my case.
Can somebody help me, please?
Would this be in specific spots or just whenever the player presses a key? Because if it's the former, it'd be a simple case of having blank events where the item is to be dropped, then activating a switch on button input processing which makes the graphic appear on a new event page of the blank event.
I don't know about a script that does this, but you can create an invisible event the player steps on that creates that kind of thing. ... maybe like a landslide or something from the vibrations of the monster creates?
If you're ok with only 1 item blocking the monster's path, it would be a simple matter of creating an invisible event, then moving the event (set event location) behind the player (use "get location info" to save the X and Y coordinates in a variable, and modify X or Y depending on the direction the player is facing) and changing its appearance.
You could also have multiple events, so the player can drop multiple blocks. You'd use a variable to cycle through the blocks, so whenever you've dropped all the blocks available, the next block would be the first one dropped. You'd need a "drop block index" variable, which you'd increment by 1 every time the player drops a block, then use the "Mod n" operator where "n" is the number of blocks available to drop. The index would go from 0 to n-1, and you'd need to handle the correct block for each index. It's a lot of work, but it gets the job done.
Otherwise, you'd need a script that can generate events on the fly.
Unfortunately, I'm not very familiar with RGSS, so I can't provide you with one.