skymen

Veteran
Veteran
Joined
Aug 26, 2013
Messages
46
Reaction score
5
First Language
French
Primarily Uses
Hello. I'm making a very simple ARPG plugin , and I can't get my code working correctly.
Here it is:
 

/*: * @plugindesc This plugin is an A-RPG test * @author Skymen * * @param Player ATK * @desc Defines the player's atk * @default 100 * * * @help Description goes here */var parameters = PluginManager.parameters('A-RPG tests');var playerATK = parameters['Player ATK'];var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;Game_Interpreter.prototype.pluginCommand = function(command, args){ aliasPluginCommand.call(this, command, args); var HP = [200,200]; var ATK = [200,200]; if (command == 'setupEnemy') { var event = $dataMap.events[this.eventId()]; var name = Number(event.name); var note = Number(event.note); if (HP.length<Number(this._eventId)) { HP.push(Number(name)); } else { HP[Number(this._eventId)]= Number(name); } if (ATK.length<Number(this._eventId)) { ATK.push(Number(note)); } else { ATK[Number(this._eventId)]= Number(note); } } if (command == 'agressive') { HP[this._eventId] = HP[this._eventId]- playerATK; } if (command == 'passive') { var event = $dataMap.events[this.eventId()]; $gameMessage.add('My new health value is ' + HP[this._eventId] + '\nand my max Health value is ' + event.name + '\nlet\'s do some math: ' +event.name + '-'+ playerATK +'=' + (event.name-playerATK)); HP[this._eventId] = HP[this._eventId]-playerATK; $gameMessage.add('My new health value is ' + HP[this._eventId] + '\nand my max Health value is ' + event.name + '\nlet\'s do some math: ' +event.name + '-'+ playerATK +'=' + (event.name-playerATK)); if(HP[this._eventId]<=0) { $gameSelfSwitches.setValue([this.mapId, this._eventId, 'D'], true); $gameMessage.add('I\'m dead'); } } if (command == 'normal') { }}What it's supposed to do is store the data contained in the name and the notes of each event that request the "setupEnemy" plugin command.
Then, when the plugin command "passive" is requested, the event's HP (stored in it's name, and then in an array) should lower. and when the value hits 0, the ennemy dies (activating the "D" self switch).

However, the life system does not seem to work properly :( .

Someone to help me?
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
85
First Language
German
What is not working properly?

Can you explain it in more detail?

And can you attach a screenshot of one event, so we can see what it should look like?

Are all your event names only consisting of numbers?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,641
Reaction score
15,726
First Language
English
Primarily Uses
RMMV
How far is it getting? Are the messages being displayed?


Are you sure it's this.mapId? I haven't looked, but I would expect it would need to be this._mapId or this.mapId() instead.


You seem to use a random mix of this._eventId and this.eventId(). I suggest you use one or the other, for consistency.
 

skymen

Veteran
Veteran
Joined
Aug 26, 2013
Messages
46
Reaction score
5
First Language
French
Primarily Uses
How far is it getting? Are the messages being displayed?

Are you sure it's this.mapId? I haven't looked, but I would expect it would need to be this._mapId or this.mapId() instead.

You seem to use a random mix of this._eventId and this.eventId(). I suggest you use one or the other, for consistency.
Thank you. That's a mistake I made.

However, when I "talk" to a monster, it calls the "passive" plugin command.

So it should update the monster's HP, but it doesn't. Each time i talk to him, his HP value is reset. Do this have something to do with the plugin command "setupEnemy" that's still working?

If so, is there a way to setup enemies only once?

(And my names and note boxes are indeed only made of numbers.)
 

kiriseo

Veteran
Veteran
Joined
Oct 27, 2015
Messages
245
Reaction score
85
First Language
German
Thank you. That's a mistake I made.

However, when I "talk" to a monster, it calls the "passive" plugin command.

So it should update the monster's HP, but it doesn't. Each time i talk to him, his HP value is reset. Do this have something to do with the plugin command "setupEnemy" that's still working?

If so, is there a way to setup enemies only once?

(And my names and note boxes are indeed only made of numbers.)
Can you post a screenshot of said event?
 

Latest Threads

Latest Profile Posts

Been playing through Skies of Arcadia again, and it really makes me wanna see someone try to implement how ship battles were done in the game into RPG Maker (or really just in general).
split.png
split view of both versions of the pocket city you traverse through. there's differences like areas only being accessible in one version of Autumn Bay. or events that only happen in one or the other.
theortically if there were a developer who spied on people's game playthroughs and changed things in real time to make it harder for them, what might be said game developer's motivation?
Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.

Forum statistics

Threads
118,431
Messages
1,115,899
Members
155,386
Latest member
Yung_DemonxSlayer
Top