@171stStreetGames Since this would be, what...your third or fourth post about this question? you'd probably be better off making an actual thread about it in Plugin Support (as the first post of this thread says it's not for questions with specific plugins).
There's also a new Blackjack plugin that may work better.
JavaScript questions that don't deserve their own thread
● ARCHIVED · READ-ONLY
-
-
Does anyone know what (core engine?) function is responsible for making (poison) states countdown on the map when the player is moving?
-
I looked up "slip" since that's what it's called in the editor, then traced that back to Game_Actor.turnEndOnMap()Does anyone know what (core engine?) function is responsible for making (poison) states countdown on the map when the player is moving?
-
Are you referring to this?Does anyone know what (core engine?) function is responsible for making (poison) states countdown on the map when the player is moving?
JavaScript:I think if you set the auto-removal timing to 2 turns, it will be 20 steps per turn.Game_Actor.prototype.onPlayerWalk = function() { this.clearResult(); this.checkFloorEffect(); if ($gamePlayer.isNormal()) { this.turnEndOnMap(); this.states().forEach(function(state) { this.updateStateSteps(state); }, this); this.showAddedStates(); this.showRemovedStates(); } }; Game_Actor.prototype.updateStateSteps = function(state) { if (state.removeByWalking) { if (this._stateSteps[state.id] > 0) { if (--this._stateSteps[state.id] === 0) { this.removeState(state.id); } } } };
JavaScript:Game_Actor.prototype.stepsForTurn = function() { return 20; }; Game_Actor.prototype.turnEndOnMap = function() { if ($gameParty.steps() % this.stepsForTurn() === 0) { this.onTurnEnd(); if (this.result().hpDamage > 0) { this.performMapDamage(); } } };
Edit: ninja'd by Turan -
Thanks, onPlayerWalk() was it. I wanted to comment it out entirely because my ABS system has poison purely as a DPS state and the player walking made it end sooner
-
Hi. So, I am making a "field state", where if a battle takes place, say, underwater, the actors attuned to the water element will be buffed. For that, I am using Yanfly's Map Linked Battle Effects, which is a "Tips & Tricks" that use the Buffs and States Core plugin, as well as the Auto Passive States plugin.
Map Linked Battle Effects (MV Plugin Tips & Tricks) - Yanfly.moe Wiki
My question is, in the context of a passive state, who is the user and who is the target? Who is applying the passive states to the actors? Say I have a sequence of code that checks if the actor is already affected by another state. Which of the following sequences is correct?
JavaScript:<Custom Apply Effect> if target.isStateAffected(15) { target.addState(53); } else !target.isStateAffected(15) { target.removeState(53) } </Custom Apply Effect>
or
JavaScript:<Custom Apply Effect> if user.isStateAffected(15) { user.addState(53); } else !user.isStateAffected(15) { user.removeState(53) } </Custom Apply Effect> -
They are the same thing. There's only a differentiation between user and target in the Buffs and States notetags that take place during action resolution in battle.My question is, in the context of a passive state, who is the user and who is the target?
-
Hey, guys! Can someone please explain why the $gameScreen.movePicture function works fine when I insert a direct value for x, but not when I use a variable?
Here's the full code just in case:
Code:var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; var params = PluginManager.parameters('Neo_BustDisplay'); var pic_id = params['Picture ID']; var coor_x = params['Coordinate X']; var pic_speed = params['Picture Speed']; Game_Interpreter.prototype.pluginCommand = function(command, args) { _Game_Interpreter_pluginCommand.call(this, command, args); var show = (command === 'ShowBust'); var change = (command === 'ChangeBust'); var hide = (command === 'HideBust'); if (show || change) { var name = args[0]; if (name === 'Diana') { name += $gameParty.members()[0].currentClass().id; } name += '_' + args[1]; if (show) { $gameScreen.showPicture(pic_id, name, 0, 1280, 0, 100, 100, 255, 0); $gameScreen.movePicture(pic_id, 0, coor_x, 0, 100, 100, 255, 0, pic_speed); } else if (change) { $gameScreen.showPicture(pic_id, name, 0, coor_x, 0, 100, 100, 255, 0); } } else if (hide) { $gameScreen.movePicture(pic_id, 0, 1280, 0, 100, 100, 255, 0, pic_speed); } };
See that "coor_x" variable? When I use it, the picture only shows up after movement is complete (like, if I put 60 frames as pic_speed, I can't see the picture until 60 frames have passed).
However, if I put a number instead (like 605) it works perfectly fine. I really don't understand what's going on, but then again, I'm not an actual plugin programmer... Can someone help me please?
Thanks in advance! -
I'm assuming params is an object that holds plugin parameters? Those are all strings, regardless of type, and you'd need to convert them to a number yourself. For example:Hey, guys! Can someone please explain why the $gameScreen.movePicture function works fine when I insert a direct value for x, but not when I use a variable?
Here's the full code just in case:
Code:var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; var params = PluginManager.parameters('Neo_BustDisplay'); var pic_id = params['Picture ID']; var coor_x = params['Coordinate X']; var pic_speed = params['Picture Speed']; Game_Interpreter.prototype.pluginCommand = function(command, args) { _Game_Interpreter_pluginCommand.call(this, command, args); var show = (command === 'ShowBust'); var change = (command === 'ChangeBust'); var hide = (command === 'HideBust'); if (show || change) { var name = args[0]; if (name === 'Diana') { name += $gameParty.members()[0].currentClass().id; } name += '_' + args[1]; if (show) { $gameScreen.showPicture(pic_id, name, 0, 1280, 0, 100, 100, 255, 0); $gameScreen.movePicture(pic_id, 0, coor_x, 0, 100, 100, 255, 0, pic_speed); } else if (change) { $gameScreen.showPicture(pic_id, name, 0, coor_x, 0, 100, 100, 255, 0); } } else if (hide) { $gameScreen.movePicture(pic_id, 0, 1280, 0, 100, 100, 255, 0, pic_speed); } };
See that "coor_x" variable? When I use it, the picture only shows up after movement is complete (like, if I put 60 frames as pic_speed, I can't see the picture until 60 frames have passed).
However, if I put a number instead (like 605) it works perfectly fine. I really don't understand what's going on, but then again, I'm not an actual plugin programmer... Can someone help me please?
Thanks in advance!var coor_x = Number(params['Coordinate X']); -
@TheNewSon You got the answer from @Mac15001900, you need to convert the parameter to a number.
Just a couple of notes to offer on other things that are not wrong, like breaking your code, but are unusual compared to best practice.
It's kind of weird to stuff that entire thing into the pluginCommand() method. It's better practice, both in MV plugin standards and in object-oriented programming, to check the name of the command and call a separate function for it.
I get how you're trying to save on repeated code by combining some of ShowBust and ChangeBust, but you can still have them out of that main function. Especially if you have any intentions of distributing this for other people to use in their projects.
Secondly, and very small, there's no need for theelse if (change)- that's inside of a conditional that's already established it's either show or change. There's no way you can be on that line and change isn't true. That can simply beelse -
How would I keep
$gameTemp.isPlaytest()set to true in a deployed game? I'd like for my testers to be able to use Ctrl to walk through things and use the F9 menu (which I have spiffed up with SRDude's advanced debug menu). -
How would I keep
$gameTemp.isPlaytest()set to true in a deployed game? I'd like for my testers to be able to use Ctrl to walk through things and use the F9 menu (which I have spiffed up with SRDude's advanced debug menu).Code:$gameTemp.isPlaytest = () => true; -
JavaScript:
/*: * @target MV MZ */ Game_Temp.prototype.isPlaytest = function() { return true; }; -
Hey guys, I need help once more!
I want to set up a skill that restores MP whenever an enemy is killed, but I can't find the right "conditon" to make it work.
I'm using Yanfly's Buffs & States Core plugin, by the way. Here is the code:
Code:<Custom Conclude Effect> if (target.isDead()) { user.gainMp(Math.ceil(user.mp * 0.02)); user.startDamagePopup(); } </Custom Conclude Effect>
If I remove that condition, it works, so I guess I'm using the wrong condition... -
The death state doesn't get applied within the span of the skill, it happens when the battler refreshes.If I remove that condition, it works, so I guess I'm using the wrong condition...
Tryif (target.hp <= 0) -
@ATT_Turan thank you so much, it worked!
Now I have another doubt... How can I make a passive skill that makes the player always succeed when escaping a battle, regardless of stats? -
i think youre out of the scope of what can be done with just the passive plugin alone for that one.How can I make a passive skill that makes the player always succeed when escaping a battle, regardless of stats?
i might be overlooking something, but AFAIK youd have to make an edit to either the makeEscapeRatio or the processEscape functions of the BattleManager to always pass if an actor has the state -
@ATT_Turan thank you so much, it worked!
Now I have another doubt... How can I make a passive skill that makes the player always succeed when escaping a battle, regardless of stats?
This solved my problem: https://forums.rpgmakerweb.com/inde...pe-fights-100-of-the-time.169766/post-1453083
Thanks! :D -
Does someone knew, where the checking "if touched" happends in the RPG-CORE-FILES ?
-
@Nafraju - it's in
rpg_objects.js:checkEventTriggerTouch&checkEventTriggerTouchFront.
[Edit: correctedTouchTheretoTouchFront.]