Post new topic    
Page «  1, 2
Slime Knight
Send private message
 
 PostWed May 08, 2013 7:45 pm
Send private message Reply with quote
I really think you would be better off not changing anything about the map state and loading up a slice (either a walkabout sprite or simply a hollow rectangle) and letting the arrow keys take up its movement.

The script would be quite a bit simpler, and you could actually move the 'look' graphic in 20px increments, as in it wouldn't 'walk' from place to place, which I think would be preferable in this situation. You could make it 'walk', too, but thats slightly more complicated.

To get the tile under the slice, just add (for x) the slice x to the camera x, then divide by 20, then read the tile/NPC/zone/whatever at that spot in tiles. (I think that math is correct)

As a note to what TMC just pointed out, if you make use of his correction, then if hero:Hero is following in the caterpillar order, 'looking' will start from that hero, as opposed to the actual leader. Maybe this is the behavior you want, but if you want look to always start from the hero leading the caterpillar, just use the constant 'me,' as in (hero x (me) )

Even if you plan on that hero always being the leader of/in the party, its good practice to make gameplay scripts somewhat adaptable so you can change circumstances a little without breaking them.
Slime Knight
Send private message
 
 PostThu May 09, 2013 7:09 pm
Send private message Reply with quote
shakeyair wrote:
I really think you would be better off not changing anything about the map state and loading up a slice (either a walkabout sprite or simply a hollow rectangle) and letting the arrow keys take up its movement.

The script would be quite a bit simpler, and you could actually move the 'look' graphic in 20px increments, as in it wouldn't 'walk' from place to place, which I think would be preferable in this situation. You could make it 'walk', too, but thats slightly more complicated.

To get the tile under the slice, just add (for x) the slice x to the camera x, then divide by 20, then read the tile/NPC/zone/whatever at that spot in tiles. (I think that math is correct)

As a note to what TMC just pointed out, if you make use of his correction, then if hero:Hero is following in the caterpillar order, 'looking' will start from that hero, as opposed to the actual leader. Maybe this is the behavior you want, but if you want look to always start from the hero leading the caterpillar, just use the constant 'me,' as in (hero x (me) )

Even if you plan on that hero always being the leader of/in the party, its good practice to make gameplay scripts somewhat adaptable so you can change circumstances a little without breaking them.



I have my story planned out, there won't be any point at which you aren't controlling that character, and I'm not using the caterpillar order so that's all fine. It would be nice to be able to use this in future games though, so flexibility is always nice.

I also think it may cause problems having to ignore NPC walls when there are other npcs around.

I will probably come back to this a little bit later on, I have a system that uses a similar mechanic. But right now I'm working on making a couple of custom menus and I think I want to get through that first.
Display posts from previous:
Page «  1, 2