Best way to have multiple obstruction maps?
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
resident

I don't even know if it's possible. But I'm thinking it would be nifty to have the player entity and enemy entities use a different obstruction map. (Actually, I'd like the game to have two maps - one real world, and one you can flip into and still see the first map running away in the background).

Here's the thing though. Entities can use zones as obstructions, but unless I'm mistaken, they'll still be obstructed by regular obstructions too. And entity.obstructible will presumably make the entity ignore both types of obstructions.

At the moment it looks like I may _have_ to implement a custom player control routine that allows the player to ignore all the normal obstructions and follows a custom obs map. If need be, I can probably deal with that, but I thought I'd ask around and see if anyone has any better ideas, because I'd really rather not throw out all the default movement and animation routines.

Posted on 2008-06-13 18:25:11

resident

Sigh, yup. I kinda feared this would be the response.

No worries, I'll work something out.

Posted on 2008-06-16 18:49:15

mcgrue

Sorry, been busy.

So, right _now_ I'd say the best way would be to have some black/white tiles in your main VSP and make your multilpe layers as alternate layers that won't normally be in your rstring.

Then when you want to switch obs layers you write a quick script that sets obs per the tile laid down on the proper maplayer.

Theoretically we could augment verge3 to have multiple optional obs layers and just switch between them via a vc command. The hard work there, really, is updating maped3.

Posted on 2008-06-19 23:03:10

resident

Really, what I wanted was to have some entities obey one obstruction map, and other entities to live by a totally different map.

What I'm trying to do is have two "maps" on the go at once, and let the player move around in the "alternate" map while entities go about their business in the "original" map. Like the Zelda Dark World, except you can see both worlds at once.

At the moment I'm pausing entities and actually doing something similar to your suggestion, only with zones rather than map layers. In retrospect, map layers make a HELL of a lot more sense - because of overlapping tiles, I need to copy two zones to the obstruction layer - one of unique obstruction tiles, and one of tiles which exist in both obstruction maps, which is terribly confusing to look at in maped and causes very troublesome bugs if a tile is misattributed.

I don't know that maped needs to be changed, though. Just a way to tell entities in VC what map layer they should use for obstructions might be sufficient.

Posted on 2008-06-21 11:00:29 (last edited on 2008-06-21 12:00:12)

mcgrue

That may be somewhat easy to do. I'll see if I can conscript someone into doing it.

Posted on 2008-06-21 18:32:44

zonker6666

This is how i would handle this issue ---


So what you want is the map to contain (for example)
1 obstruction zone that only the player is constrained to ..
2 a second obstruction zone for enemies that are type A
3 a third obs zone for enemies that are type B

(obviously adding more obstruction zones for type C D E etc enemies is just as easy following this method ...

First off you need to have a VSP that contains a set of tiles that are simply symbolic and will always use the same TileIDs.
In our example we'll use tiles 1 to 16 ---- in case you choose to add a few more Obs

#define OBS_Player 1
#define OBS_TypeA 2
#define OBS_TypeB 3

#define OBS_Layer 5

// these next 2 stand for Maximum Map Width and Height
#define MMW 100
#define MMH 100

int ObstructionsPlayer[MMW]MMH];
int ObstructionsA[MMW][MMH];
int ObstructionsB[MMW][MMH];

Now design your map using maped 3 as you usually would
but you must remember that Layer 5 is only going to contain symbolic tiles ...... save your map and have them run the script initialize_map ...

Meanwhile in initialize_map

void initialize_map()
{
int x,y;
int temp_tile;
for(x=0;x<map.width;x++)
{
for(y=0;y<map.height;y++)
{
ObstructionsPlayer[x][y]=0;
ObstructionsA[x][y]=0;
ObstructionsB[x][y]=0;
/// Add other Obstruction Arrays as needed.
}
}
for(x=0;x<map.width;x++)
{
for(y=0;y<map.height;y++)
{
temp_tile=GetTile(x,y,OBS_Layer);
if(temp_tile==OBS_Player)
ObstructionsPlayer[x][y]=1;
temp_tile=GetTile(x,y,OBS_Layer);
if(temp_tile==OBS_TypeA)
ObstructionsA[x][y]=1;
if(temp_tile==OBS_TypeB)
ObstructionsB[x][y]=1;
}
}
}


ill post more on this later tonight

Posted on 2013-01-16 02:36:35


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.