JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 7 of 171 View original ↗
  1. KockaAdmiralac said:
    @Lakaroth

    Nope, I think that method does not exist even in RGSS

    But here is a plugin that does that :

    (function(){  var _kocka_random_alias_intialize_l2h9HbeF = Game_Map.prototype.initialize; Game_Map.prototype.initialize = function(){ _kocka_random_alias_intialize_l2h9HbeF.apply(this, arguments); this._changedRegions = [];}; Game_Map.prototype.regionId = function(x, y) { return this.isValid(x, y) ? this._changedRegions[x] ? this._changedRegions[x][y] ? this._changedRegions[x][y] : this.tileId(x, y, 5) : this.tileId(x, y, 5) : 0; }; Game_Map.prototype.changeRegionId = function(x, y, value){ if(!this._changedRegions[x])this._changedRegions[x] = []; this._changedRegions[x][y] = value; return this._changedRegions;}; })();Just use a script call to $gameMap.changeRegionId(x, y, value);
    Thank you so much!

    There's a way to change all ID7 region to ID5 (For example) ?

    Best!
  2. That is a whole plugin then.

    It's here

    Note that changes made aren't permanent, that means whenever you enter the map regions will reset.

    But you can have an autorun event that handles those.

    Also, if you switch region 5 to 7, and later you want to change 7 to 8, you must switch 5 to 8, not 7 to 8.
  3. KockaAdmiralac said:
    That is a whole plugin then.

    It's here

    Note that changes made aren't permanent, that means whenever you enter the map regions will reset.

    But you can have an autorun event that handles those.

    Also, if you switch region 5 to 7, and later you want to change 7 to 8, you must switch 5 to 8, not 7 to 8.
    Thank you very much!!!!

    EDIT:

    Hem i try it but doesn't work, maybe it's my mistake...

    Inside an event i put the plugin command:

    ChangeRegionId switch <5> <7>

    It's ok?

    If doesn't work is possible for some others plugin conflicts?

    Best
  4. How would i go about making equipment that get bonuses in battle when the character is under a particular state.  For example, I have an oil themed armor that will double a character's speed, but only while they are burning.
  5. TheGamedawg said:
    How would i go about making equipment that get bonuses in battle when the character is under a particular state.  For example, I have an oil themed armor that will double a character's speed, but only while they are burning.
    Hi there, it's pretty easy with Events Command > Conditional Branch >

    burn.png

    If you add an Else case, you can remove the Bonus ;)
  6. Lakaroth said:
    Hi there, it's pretty easy with Events Command > Conditional Branch >

    burn.png

    If you add an Else case, you can remove the Bonus ;)
    That's cool, but do you think there may be a way to make it work with any character, or do you need to add a branch for each individual character in your game?
  7. TheGamedawg said:
    That's cool, but do you think there may be a way to make it work with any character, or do you need to add a branch for each individual character in your game?
    With event system i think you need to make an events for any characters.

    Let me think but i'm almost sure....

    Because a "state" it's relative to a specify character, with Javascript you can do everything, but i'm not a developer. i cant help you with that.
  8. @Lakaroth

    Don't use <>'s

    Just do ChangeRegionId switch 5 7
  9. KockaAdmiralac said:
    @Lakaroth

    Don't use <>'s

    Just do ChangeRegionId switch 5 7
    Yeah thanks, i'v solved and forgot to update the post.

    Thank you so much!
  10. could someone please show me an example of how to alias (like aliasing a method from RGSS3) a function in JS if possible?
  11. dbchest said:
    could someone please show me an example of how to alias (like aliasing a method from RGSS3) a function in JS if possible?
  12. If you want to alias Game_Action.prototype.apply :

    var _your_alias_name_and_some_random_numbers = Game_Action.prototype.apply;Game_Action.prototype.apply = function(){    _your_alias_name_and_some_random_numbers.apply(this, arguments);    // your code here...}Sometimes, if you get an error on aliasing try :

    _your_alias_name_and_some_random_numbers.call(this, <insert parameters here>);EDIT: Thanks @Iavra!
  13. It's "arguments", not "parameters", though ;)
  14. Nothing I'm doing in Window_Status.prototype.drawParameters (around line 2594 or rpg_windows.js) is doing anything.  I though editing that would allow me to shift around and edit how the parameters are drawn, but nothing I do seems to be even changing.
  15. @TheGamedawg

    Look at Window_Status.prototype.drawBlock3 (I don't know what line is it, I have split source files)

    You'll see :

    Window_Status.prototype.drawBlock3 = function(y) { this.drawParameters(48, y); this.drawEquipments(432, y);};This will draw parameters on x coordinte 48, and equipments on x coordinate 432.Y coordinates of these windows are defined deeper.

    Look at Window_Status.prototype.refresh, and you'll spot lines :

    var lineHeight = this.lineHeight();...this.drawBlock3(lineHeight * 7);That means previously mentioned parameters and equipments have Y coordinate of lineHeight * 7, where lineHeight is this.lineHeight().Now look at Window_Base.prototype.lineHeight

    You'll see that lineHeight is actually 36, and that leads us to drawing equipments and parameters at Y coordinate of 36 * 7 = 252. and that leads us to drawing parameters at (X, Y) = (48, 252) and equipments at (X, Y) = (432, 36)

    And I really recommend you that, if you are working with plugins a lot, check out Zalerinian's JGSS DevKit
  16. You guys know when you're calling certain parameter in javascript you use certain tags?  You know, like actor.stateRate(i) for your state rates, actor.mrg for your magic regain rate, or actor.cri for your critical rate?  Well, what are the tags for your Attack State numbers?
  17. Hi guys, i want change fonts effects in the all game, there's an outline, black in the text, i want remove that.

    Where's the part in rpg_windows.js?
    I cant find it...

    There's Yanfly core plugin who do that, but i dont want use it it give me some conflicts in my game with others plugins...
    Thanks
  18. Hello all, I was wondering how to return the value of the current event's id. I'm not much of a scripter, though I use script call to assign values. In VX Ace it was something as simple as:

    value = event_id

    It doesn't seem to work for MV. I feel like I'm missing something obvious haha. I appreciate the support!
  19. @Lakaroth 

    In Bitmap.prototype.initialize you'll find lines (not really like this, in far more rows...):

    Code:
    this.fontFace = 'GameFont';                 // The face name of the font    this.fontSize = 28;                         // The size of the font in pixels.    this.fontItalic = false;                    // Whether the font is italic.    this.textColor = '#ffffff';                 // The color of the text in CSS format.    this.outlineColor = 'rgba(0, 0, 0, 0.5)';   // The color of the outline of the text in CSS format.    this.outlineWidth = 4;                      // The width of the outline of the text.
    @10theodie10

    If you want to get current event iD I *think* you can use
    Code:
    this._eventId

    And if you want to assign it to a variable you can use :
    Code:
    $gameVariables.setValue(<variableiD>) = this._eventId

    Just remember to change <variableiD> to your variable iD
  20. Thanks!