Play animations via script from a common event

Status
Not open for further replies.

matheus872

Villager
Member
Joined
Jul 29, 2020
Messages
9
Reaction score
0
First Language
Português
Primarily Uses
RMMV
Hello everyone,

I'm trying to use a common event calling a script for play an animation on the current map in front of the player...

The intention is like to play the animation of the leaf beeing cuted when the player use a tool like the stickle, if that works will use a tile change to remove the plant for a terrain tile, kind of a abs system. I can't use the plants images in the events instead of the map, should loose a massive stuff of autotiles.





I have used variables to store the (x,y) coordinates of the player, them i correct the coordinates to be in front of the player according to his direction (ex: player direction equals 4 (<-) them x -1, y), so i store the event id suposed to be in that coordinate and make a script call for play a animation on this event id.


scr.png
The event ID check it's working, and the variable id 21 is where i stored the return of get location info.
137 its the id of the leaf animation.

Don't worrie about the plugin, he does'nt affect directly the question, basicaly, the plugin able the player to switch between tools and use that tools by pressing 'alt' in front of an event that have a notetag like the <plant:1> notetag in the code above.


Unfortunely, i can't anchor the animations in a empty event in front of the player too , cause already must have an event there , with the <plant:1> notetag, to that able the player to use the stickle. Same for use a abs system :(

But looks like the common event does'nt recognize the current map, so the script i'm using not works. Hope anyone can help me :s

Thanks in advance!
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
202
Reaction score
92
First Language
spanish
Primarily Uses
N/A
Galv has a plugin to play animation on any map coordinate:


Using this you can play the animation on the X, Y position you want with no event :D
 

matheus872

Villager
Member
Joined
Jul 29, 2020
Messages
9
Reaction score
0
First Language
Português
Primarily Uses
RMMV
Galv has a plugin to play animation on any map coordinate:


Using this you can play the animation on the X, Y position you want with no event :D

Hi @stramin,

I had tried this plugin before, the point is that using it you can define animations to occur when the player passes through a region, through a notetag in the animation. As far as I could see it wouldn't work, because in my project, the player can change the maps, planting a bush for example, not to mention that the animation would be activated as soon as the player passed through the region (In all points marked with that region ) and not when using the tool, where he is using it.

I also need to launch a mobile version, which is not recommended by galv in the instructions for this plugin for performance reasons.

Thanks for your attention, I really appreciate the intention to help. :)
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
202
Reaction score
92
First Language
spanish
Primarily Uses
N/A
I see, I wonder if there are any plugin to play an animation in a map position using a plugin call.

For example, a plugin command like this:
PlayAnimation 18 35 22
Where the numbers are Animation ID, X position and Y position

Another way to do it is using Yanfly Event Spawning to spawn a new event when you don't detect any event in that position and use the spawned event to play the animation.

If you don't want to use the plugin, you could create a new event in all the maps where you can use that tool and change that event position in front of the hero and play the animation on it.
 

matheus872

Villager
Member
Joined
Jul 29, 2020
Messages
9
Reaction score
0
First Language
Português
Primarily Uses
RMMV
these forms do not work because to use the tool an event must already exist in that position (with the notetag), would generate conflicts. But now I'm thinking and maybe it will work with the Yanfly event morpher, I'll try and update here soon.
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
202
Reaction score
92
First Language
spanish
Primarily Uses
N/A
I made a small project to show what I mean with the spawner, if you press action button a default animation will play in front of the hero:

 

Oir

Veteran
Veteran
Joined
Dec 19, 2020
Messages
104
Reaction score
45
First Language
English
Primarily Uses
RMMV
I see, I wonder if there are any plugin to play an animation in a map position using a plugin call.

For example, a plugin command like this:
PlayAnimation 18 35 22
Where the numbers are Animation ID, X position and Y position

Another way to do it is using Yanfly Event Spawning to spawn a new event when you don't detect any event in that position and use the spawned event to play the animation.

If you don't want to use the plugin, you could create a new event in all the maps where you can use that tool and change that event position in front of the hero and play the animation on it.

You could always use Yanfly's Picture Spritesheets (although it's not much different than using the Show Picture Event command other than having more control and organization capabilities.)
 

matheus872

Villager
Member
Joined
Jul 29, 2020
Messages
9
Reaction score
0
First Language
Português
Primarily Uses
RMMV
It worked! I thought that putting two events in the same coordinate could cause some conflict but apparently it didn't cause any problems, hopefully it won't cause problems afterwards hehe. I added the missing plugins and with a few more changes everything went well! The final result looks great for me XD i just have to improve these animations and will be 100%.




An interesting thing that happened was that in the first script of this thread I just added a command to move any event just above and the script started to work, as if the common event started to recognize the current map, but i changed the logic anyway.

Thank you verry much @stramin and @Oir
 

matheus872

Villager
Member
Joined
Jul 29, 2020
Messages
9
Reaction score
0
First Language
Português
Primarily Uses
RMMV
Mods this thread can be closed
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,791
Reaction score
8,759
First Language
English
Primarily Uses
RMMV
@matheus872 Next time please use the report button to be sure that we see it.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I found a book about game localization. It costs R$708,00 on Amazon. ;_;
I really wish my game was far enough along for it to be actually playable beyond certain aspects. I think I've crafted a really fun battle system thanks to ATB, fighting game, and Boost point mechanics.
Play test of my current progress on Happy Camper
Cutscene Contest Winners have been announced!

I'm heading back to Orlando tomorrow! My dad and I have forgiven each other, so we're planning to spend Spring Break together. We'll probably go to SeaWorld and Aquatica one day, and maybe even use my air fryer to make something to go with Dad's grilled steak. The train leaves tomorrow, and I'll be working on my game on board!

Forum statistics

Threads
109,111
Messages
1,042,180
Members
141,608
Latest member
Sinthea
Top