Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Dropping the Battleback in XP

Injury

Awesome Bro

Hello, long time no serious post...

I've been messing around with scripts in a minor project and I'm stuck! I've been trying to get rid of the battleback calls so that when you are transfered to a battle, the battleback wouldn't load. That worked, but I don't know how I could go about leaving the map screen behind it. Kind of like VX, but I'm going to be taking it steps further.

Please let me know at your leisure... :heart:
 
You can't "leave" the map there, because the map spriteset gets disposed when the map scene ends.
However, you should be able to recreate it instead of using the default battleback.
At the top of 'main' in Scene_Battle 1

@spriteset_bg = Spriteset_Map.new

then at the bottom of 'main'

@spriteset_bg.dispose

There MIGHT be a conflict with the viewports. Let me know if this works.
 

Injury

Awesome Bro

It worked! Thanks again! I had already been tinkering with viewports and whatnot, so I didn't know if they were a problem. Trying it out in a fresh project, it didn't throw an error at all, even though it loaded the battleback and whatnot. After taking the battleback out, you had to remove the viewport1 statements as well as the dispose and tone code.

Now that that is taken care of..a quick question as to how I'd make the arrow_base /_enemy classes point to the actual map sprites. I'll tinker with it, but I'm sure you know how.

Thanks again, seriously! :rock:

EDIT:
ohh, well I thought of another problem...If the arrow_enemy class would be used, I'd need to find a way to put the troop data to use and apply identifiers to enemies and stuff.

example:
[identifier]EnemyName.TroopEnemy# (or whatever)
Ghost*2 (default battle troop 1)
[E]ghost1
[E]ghost2

agreed? thanks!
 
Ok, so you're going to basically use invisible battlers, right?
Will you have all of the enemies on the map? Or do they appear when battle starts?
And I suppose you'll also need to add the additional party members, unless they are on the map with a caterpillar script or something.

Anyway, In the Spriteset_Map object you created, each event & the player are part of @character_sprites array. And each Sprite_Character has @character as a property, which points to a Game_Character object, which has 'x' & 'y' properties (map position).
So, you should be able to access those positions, translate them into screen coordinates, and set the @enemy_sprites positions in Spriteset_Battle.
then the arrows should point to the right location.
If you only have the lead player on the map, then you will need draw the other actor sprites in some sort of formation around the lead actor.
 

Injury

Awesome Bro

Yes, exactly! I was hoping to create an effect of real time battle mapping so there is more diversity vs the same battleback every time.

So what I'll need to figure out from here is adding the additional heroes and enemies using events as reference points. It might also help to add some kind of active battle script. If you can think of anything else that'd futz this up, let me know.

One thing that is making me worry is how do you translate @character.x or .y (screen coords) to map coords, as well as separate each enemy/character to their proper place (the event referring to them) in the code?

Gah...I'll keep messing around with things. I think that it should be a simple as possible, but fluid and dynamic in presentation.

You've been a tremendous help! You'll be getting lots of credit for this bud! WOO progress!
 
NFP. I've actually considered doing a turn-based battle system (pretty much the default system) but with 'positioning' & 'passage' based on current map location.
So, in a narrow passage only the lead actor & enemy would battle. Or even in an open space, you'd have to move up to the enemy to melee.
Spell effects could also have a radius of effect, where an actor could take some damage from say, a fire-ball if he's too close to the target enemy.

So I've looked at some of this stuff.

@character.x (& _y) are map coordinates
$game_map.display_x (& _y) are the current maps offset in the screen. (in what seems to be 1/4 pixels. (tiles * 128))
I still haven't quite figured out the '128' thing.
Then the Game_Actor.screen_x & y, Game_Enemy.screen_x & y are the battler positions in full pixels.

Have fun with it!
 

Injury

Awesome Bro

Awesome! Thank you very much!

I want to say that 128 is apart of centering the character/screen on the map. You'll see it come up often in Game_Map for scrolling in any direction, etc.

As for your turn based system, maybe you could make events that are tagged with a "no attack/no pass" pointers that point to the position on the map that can't be used. I wonder what Gubid did. Probably a simple passability using the tilesets properties set form the database.

Either way: YOU ROCK. end of story.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top