Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Pokemon Teal Help


TailsSena

Recommended Posts

So... How do I make two Sub-Applications share information? I'm trying to make a game that looks like a DS game, two screens included.

(Don't ask why.)

Anyway, the top screen is the one with tons of programming, using my own Isometric engine... The bottom can display a map, a status screen, and a pause screen... Regular DS stuff... But all of them require the top screen's values to be shared with the bottom...

Link to comment
Share on other sites

One of the few things the sub-app can share are global values and strings, so you'd have to take the values to want to share, stuff them into globals, and then read those same values on the sub-app side. Keep in mind you'll be setting yourself up for headaches by using the sub-app though...

Link to comment
Share on other sites

Sub-applications have the "Share" properties for Global Values/Strings, and Score/Lives values.

Simply add the values you need to your parent application, and have both-subapps with the share global values property on. The values will carry on to any of the three applications as you modify them.

Link to comment
Share on other sites

Ohhh... I think I gotcha. The main app lists the values, which both Sub-Apps can modify and read from... Correct?

Now, is there a setting for "Master" and "Slave" between the Subs, or will I just have to make sure that the bottom one never modifies anything, only reads?

EDIT: Well, it works so far! Thanks!

(Seems I didn't check the Sub-Application Properties thoroughly before. Now that sharing is set up, it works fine.)

Link to comment
Share on other sites

There isn't any control of that degree. If you modify the values in the sub-app, the parent app will behave unexpectedly.

And yes, that's how it works - if you add new GVs in the parent app, the sub-apps will be able to make use of them as well.

Link to comment
Share on other sites

Seems that in your case no discernible contradictions are prominent.

Yet. Just wait until Sub2 starts doing things that matter.

For clarification, this is a Pokemon game I'm making, so Sub2 will wind up effecting stats and such, which both Subs keep track of.

That said, are there any special checks/over-rides I should put into the Parent so that things don't go insane?

Link to comment
Share on other sites

  • 2 weeks later...

Depends on what you're trying to do. Based on your topic title I'm assuming you want to check when a trainer is facing you to initiate a battle?

The GBA/DS pokemon games use a tile-based system, where you can only move within a grid. This made it easy to check if one object was facing another as you just trace down a few tiles checking what occupies each tile and stopping iteration if an obstacle such as a rock was encountered. If you are not constrained to a grid in your game however, you'll want to do a rectangle area check. In the example below I'll show how you could handle "seeing" the player when the trainer is specifically looking down (I don't check for obstacles here, and I'm also implying 32x32 tiles and a max range of 5 tiles):

Dir("Trainer") = 24

X("Trainer") < X("Player")+16

X("Trainer") > X("Player")-16

Y("Trainer") < Y("Player")

Y("Trainer") > Y("Player")-160

-
Request Duel with Player

Link to comment
Share on other sites

Actually, I'm checking to see if you're facing an NPC so you can talk to it.

Also, the overworld works like Ranger... No grid, no constraints, everything is real time, all encounter-able things are visible. (This includes wild Pokemon.)

...But that might work.

EDIT: Not quite... I need to be able to talk to someone regardless of where I am, as long as I'm within range of them and facing them...

EDIT2: Actually, I think I'll devise another way that involves touching them on the bottom screen as they come in range on the top screen.

Link to comment
Share on other sites

  • 1 month later...

Hmm. Does anybody know how to set an object's position so that the object to be positioned is determines by a calculation?

Basically, I need to set the position of an object that the runtime doesn't actually know is going to exist.

The reason for this is simple enough. It's how I'm creating the Pokemon... You see, I'm creating them by name based on which one needs to be created, with but one line of code.

P_Poke01 is different from 0
 - &gt; Create object "Poke "+P_Poke01

Basically, when the value of your first Pokemon isn't zero (aka; nothing), the Pokemon corresponding to that number is created.

My problem is that the runtime no longer knows which Pokemon will exist at any point in time, so I can't reposition them unless I can use a Calculation to determine which one to move...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...