- Joined
- Nov 26, 2015
- Messages
- 106
- Reaction score
- 20
- First Language
- Italian
Hi everybody,
I'm having trouble trying to create an event via script, at the moment I'm trying through the console but I haven't go any result so far.
I tried doing this:
$gameMap._events[4] = $gameMap._events[3];In the map i'm using for testing events go up only to 3 so with this line i tried to create a new event and copy it from an existing event to fill-out every paramenter in a way that should be functional.
The only thing this made is to speed up the event3, I guessed it had to do with the fact that at the moment of the creation the new event shares the same event Id with the mold, so maybe somewhere in the code his movement is called twice or something like that. At that point i tried to change the event id like this but it resulted in a fatal error:
$gameMap._events[4]._eventId = 4;So I searched for where in the script a new event is created calling the Game_Event constructor ad i found this
Game_Map.prototype.setupEvents = function() { this._events = []; for (var i = 0; i < $dataMap.events.length; i++) { if ($dataMap.events) { this._events = new Game_Event(this._mapId, i); } } this._commonEvents = this.parallelCommonEvents().map(function(commonEvent) { return new Game_CommonEvent(commonEvent.id); }); this.refreshTileEvents();};So I tried this line
$gameMap._events[4] = new Game_Event($gameMap._mapId, 4);but it gave me error until i populated $dataMap.events[4], but still it doesn't seem to work properly.
Any Idea?
I'm having trouble trying to create an event via script, at the moment I'm trying through the console but I haven't go any result so far.
I tried doing this:
$gameMap._events[4] = $gameMap._events[3];In the map i'm using for testing events go up only to 3 so with this line i tried to create a new event and copy it from an existing event to fill-out every paramenter in a way that should be functional.
The only thing this made is to speed up the event3, I guessed it had to do with the fact that at the moment of the creation the new event shares the same event Id with the mold, so maybe somewhere in the code his movement is called twice or something like that. At that point i tried to change the event id like this but it resulted in a fatal error:
$gameMap._events[4]._eventId = 4;So I searched for where in the script a new event is created calling the Game_Event constructor ad i found this
Game_Map.prototype.setupEvents = function() { this._events = []; for (var i = 0; i < $dataMap.events.length; i++) { if ($dataMap.events) { this._events = new Game_Event(this._mapId, i); } } this._commonEvents = this.parallelCommonEvents().map(function(commonEvent) { return new Game_CommonEvent(commonEvent.id); }); this.refreshTileEvents();};So I tried this line
$gameMap._events[4] = new Game_Event($gameMap._mapId, 4);but it gave me error until i populated $dataMap.events[4], but still it doesn't seem to work properly.
Any Idea?
