Shoting system specific

Ah, that's because the map events array isn't structured like this.


It actually is the length of the maximum id of the events in editor (with position 0 being null), and doesn't fill the empty IDs.


So, if you had events with ids 1,2,6 and 8 on map, the array would be: [ ,event1,event2, , , ,event6, ,event 8].


You do have positions 0-3-4-5-7 they are just empty (null).


Edit: It seems I made a mistake.


Position 0 isn't filled with a placeholder event as I thought, but after checking, it's just null. This doesn't really change anything. But well, for the sake of precision I thought I should update my answer.
First te code check if the vent exist and only then execute next code. Second,  this.character(0).x exist , you can't do directly this.x. It's work grat on most of my codes.
Apparement ca ne fonctionne pas. j'ai remplacé id par le bon nombre. Mais mystere tout le modne donne touours des truc qui commence par _, ici ca ne fonctionne jamais lol. 


$gameMap._events[id]._direction = $gamePlayer._direction


Mais a la place je pourais pas mettre:


this.character(0).direction=$gamePlayer.direction

Original thread: https://forums.rpgmakerweb.com/threads/shoting-system-specific.63531/