Converting my sandbox to pluggin

I curently have a sansbox, it's an objet that we can push on the map and have different property.


It's working but I start tinking that will be bettle if I convert it to pluggin.


Basicly it's a box that we cna push on the floor. 


When I push it I move with it too, but if the box is on a ice floor that push the objet without moving in same time.


Ice floor is designed by a specific terrainid or regionid(regionid not programmed yet)


It's also play a sound.


The sandbox can also be use for activate switch on the floor. These switch are designed with a specific regionID or terraintag(terraintag not coded yet).


Like you can see in the code, if the user push the sand box on the regionID 255, that will inscrase a variable by one and if removed that will decrease variable by one.


In my current code, I did't put anything for detect if when the objet move on ice if he enconter a switch on floor(region id 255) because I don't think I will need it.


Finally he have a tag that help other script to detect that this objet can protect from projective, but I don't think it's need to be a part of a script because it's can be added to the even directly.


If you think that I must not ask for this in a pluggin just tell me and why, I lvoe to have opinion of everybody =:0)

b.png

a.png
Hi again 😛


Yes you can easily do all this with short events istructions.


For the code that make the block slide on ice you can make a self switch on as soon the block is pushed that activates a parallel process page.


in this page the code can check wether or not the block is on ice and if so continue moving, otherse if it's not on ice or it ecnountered an obstacle it will set the self switch off


this is how you can do it


example.png


!this.event().isMoving() returns true when the event is not moving (the ! inverts the value), this relies partially on the other plugin i made for you, if you want it to be indipendent you can use this line (which maybe is safer, it takes also the same computing time)


!$gameMap.events()[this._eventId].isMoving()


where there is the comment you have to add the command that move the block forward for another step.


on top you can see Se: Script : IS ON ICE it obviously doesn't work it's just to show what you have to put there, a conditional branch (IF) that turns true if the block is on ice. this IF needs to have an ELSE section in which you have to put one of the 2 Self Switch OFF instructions

Original thread: https://forums.rpgmakerweb.com/threads/converting-my-sandbox-to-pluggin.64719/