RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Side View Arrangement

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 88
As you can see, with the screenshot I took of my game, I can place ONE battler in the side part of the screen. To do this heres what's in my script.

Spoiler for:
#--------------------------------------------------------------------------
  # * Get Battle Screen X-Coordinate
  #--------------------------------------------------------------------------
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index * -200 + -100
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen Y-Coordinate
  #--------------------------------------------------------------------------
  def screen_y
    if self.index != nil
      return self.index * 5 + 390
    else
      return 0
    end
  end

And the problem with that is that it messes with the direct positioning of the battlers. Is there a way I can make the battlers appear in the red boxes I have drawn into the screenshot? Just in the same places as the boxes, not necessarily exactly in them.
« Last Edit: September 12, 2007, 05:55:19 PM by Xionixx »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, you can just calculate the x's and y's to be based more on the index of the position that that character has in the battle. I think that is what you are doing, but your x is too drastic, multiplying index by -200 will quickly move succesive characters off screen. I would keep that one fairly low, and I also would not do it with minuses. I would start at or a relatively low number and go up by maybe 50 or so. As for the y, it's too low, in my opinion. Only 5 pixels of each actor will show up behind the character before them.

It might be better to have something like this:

Code: [Select]
#--------------------------------------------------------------------------
  # * Get Battle Screen X-Coordinate
  #--------------------------------------------------------------------------
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index*(60) + 50
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen Y-Coordinate
  #--------------------------------------------------------------------------
  def screen_y
    # Return after calculating y-coordinate by order of members in party
    if self.index != nil
      return self.index*(-50) + 320
    else
      return 0
    end
  end

**
Rep: +0/-0Level 88
I tried putting in what you said, and as you can see by the screenshot, it only moved the second party member to the center, and if you take out everyone but the main character it just moves the player's battler to the center.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
put a print statement displaying self.index right above 'return self.index*(60) + 50' so that it looks like this:

p self.index
return self.index*(60) + 50

And if that returns as 0 the first time and as 1 the second time, give me the specifications of the pictures (i.e. size in pixels vertical and horizontal). Also, test for 3-4 players as well and tell me the results.


**
Rep: +0/-0Level 88
Yeah it kept popping up the number 0 for one member in the party, but every time I clicked OK on the window that popped up, it'd shift from the center of the field to the left. With 2 members they were somewhat organized but still moved left to right. This time 0 and 1 would pop up.

At 3 members, the battlers still moved left and right but less, and 0, 1 and 2 popped up. At 4 members, they didnt shift anymore but 0, 1, 2, and 3 kept popping up, which I understand was the point right?

I took a screenshot of it, and I think the third and fourth battlers are a little too high.

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
You could always use an if statement? Or just edit some windows for more room?

**
Rep: +0/-0Level 88
How exactly would that work? I'm not much of a scripter, if I can call myself that at all.

*
A Random Custom Title
Rep:
Level 96
wah
Probably something along the lines of if $game_actors.party.actors = 1, then put him somewhere. if $game_actors.party.actors = 2, put someone here, put someone there, etc. Something like that?

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Code: [Select]
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index == 0 ? 75 : self.index == 1 ? 165 : self.index == 2 ? 255 : self.index == 3 ? 345 : 0
    else
      return 0
    end
  end
I think that's what Moo meant but this wasn't actually tested to be properly alligned like you want and probably isn't. The way I did it though is an advanced way of using conditional branches. Here's an explanation on advanced "if" branches and a simpler explanation below it.

Code: [Select]
condition ? True : False
Condition is what you're checking. It could be something like "self.id != 0" or "@actors[index] != nil".
True is what'll happen if condition returns true.
False is what'll happen if condition returns false.

Basically what I did in the first code box I posted is that I used the advanced "if" branch to avoid a long, drawn out method that might lag the battles to no end. Lag in a battle is the one of the quickest ways to tick off a player.

This is what you can do if you didn't understand the above explanation.
Code: [Select]
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      if self.index == 0
        return 50
      if self.index == 1
        return 40
      if self.index == 2
        return 30
      if self.index == 3
        return 20
    else
      return 0
    end
  end

If you're still unclear on anything, don't hesitate to ask.

@moo
Why in the world would you use $game_actors.party.actors when self.index means the same thing? After all, you would have to use $game_actor[index].screen_x/y/z to call the method anyways. The reason self works is because self is refering to the actor's index you used when you called the method.

**
Rep: +0/-0Level 88
Ok, using what Shinami told me to do, and I messed around a little with the numbers and I managed to get the first screenshot.

Now, let's say I wanted to move them down a little, could I just use this code for Y just replacing the Xs with Ys?
Code: [Select]
def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index == 0 ? 75 : self.index == 1 ? 165 : self.index == 2 ? 255 : self.index == 3 ? 345 : 0
    else
      return 0
    end
  end

Also, the positions don't seem to be fixed I guess you could say. It works just fine if there's a full party of four, but as you can see from the second screenshot, it moves them back to the center once you take out the other ones. Is there a way to set the slots in the party to a particular spot in the screen?

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
Why don't I throw this in requests, since it seems all you're doing is playing with numbers.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Post your screen_x and screen_y methods from Game Actor and Window_BattleStatus please?
« Last Edit: September 11, 2007, 11:14:31 PM by Shinami »

**
Rep: +0/-0Level 88
Post your screen_x and screen_y methods from Game Actor and Window_BattleStatus please?

Here's what I have for the screen coordinates for Game_Actor. I haven't changed anything in Window_BattleStatus, so I don't know what to do there but after messin' with the values, it ended up like shown. See, the code itself as is now will only look good when used with 3 members in the party, any more or less looks horrid.

Code: [Select]
#--------------------------------------------------------------------------
  # * Get Battle Screen X-Coordinate
  #--------------------------------------------------------------------------
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index == 0 ? 0 : self.index == 1 ? 50 : self.index == 2 ? 100 : self.index == 3 ? 150 : 0
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen Y-Coordinate
  #--------------------------------------------------------------------------
  def screen_y
    # Return after calculating y-coordinate by order of members in party
    if self.index != nil
      return self.index == 0 ? 350 : self.index == 1 ? 300 : self.index == 2 ? 250 : self.index == 3 ? 200 : 0
    else
      return 0
    end
  end

*
A Random Custom Title
Rep:
Level 96
wah
@moo
Why in the world would you use $game_actors.party.actors when self.index means the same thing? After all, you would have to use $game_actor[index].screen_x/y/z to call the method anyways. The reason self works is because self is refering to the actor's index you used when you called the method.
Because I wasn't paying attention at all to the script or anything. Lol.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Are you using any other scripts? Please post them if you are. The screen_x/y methods you posted aren't at fault. I use similar methods in a CBS so I know that for sure.

**
Rep: +0/-0Level 88
Are you using any other scripts? Please post them if you are. The screen_x/y methods you posted aren't at fault. I use similar methods in a CBS so I know that for sure.

Tons of Add-Ons Script by Blizzard, which I think is interfering. I think it's the one that centers your battlers when only using one or two members in the party that could be affecting it.

Here, I'll put it up.

EDIT: Argh! It's too big. But I'm sure you know the one I'm talking about.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Disable the addon you think is interfering. From the way you described it, that sounds like the culprit.

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
From now on, please tell us what other scripts you are using! (Also read the request rules when you get a chance)

**
Rep: +0/-0Level 88
From now on, please tell us what other scripts you are using! (Also read the request rules when you get a chance)

I never intended for this to be a request. You moved it from Scripts Help.

Damnit you guys, sorry I didn't mention the other script, but yeah that was it! Thanks a lot for sticking around to help me.

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
Don't worry about it.

This topic is resolved, so I think I'll lock it.