Post new topic    
Slime Knight
Send private message
Conditionals for map layers above walkabout? 
 PostWed Nov 12, 2014 4:08 pm
Send private message Reply with quote
I've been using between 3 and 5 layers in most of my maps, and have had good luck getting them all lined up and working. I had a question about making a floating layer conditional depending on the direction from which the hero enters that tile.

I have some shaggy grass, and corn/wheat field graphics that are less than 1 tile high on a floating layer that work great when my hero walks across the tiles left or right. When the hero walks up or down, the effect does not work, the hero just goes beneath the floating layer, which is of course, expected.

I was just wondering if there would be a way to have the hero walk above the floating grass layer when walking up or down over it, abut still walk beneath the same layer while moving left or right.

If anyone has any tips, tricks of work-arounds regarding this, I would love to hear them. This is not a crucial part of this game, but just something that I have wondered about. Perhaps this could be achieved using zones? Anyway, thank you.
Liquid Metal King Slime
Send private message
 
 PostWed Nov 12, 2014 4:30 pm
Send private message Reply with quote
Yes Urkealbot, it's actually really simple to do.
You just need to use scripting. You have a 1 line script that changes the maptile from overhead to underhead™ and another script that reverses that.
Then you place npcs on each side and load them up witht he correct scripts.
Simple.


Of course, this is assuming you have some scripting knowledge. In order to build your scripting knowledge I suggest looking through the wiki.
http://rpg.hamsterrepublic.com/ohrrpgce/Plotscripting

With a focus on the plotscript dictionary
http://hamsterrepublic.com/ohrrpgce/docs/plotdict.xml


The code you'll need for this will likely end up being
write map block (x,y,value,layer)


I can't help you anymore than this without you having a good understanding of scripting and how to implement them into games.
Slime Knight
Send private message
 
 PostWed Nov 12, 2014 6:53 pm
Send private message Reply with quote
Thank you very much! I'm not too terribly familiar with scripting, but I'm learning. So far I've used scripting to prompt battles Earthbound style, Trigger stairstep noises with invisible NPCs, Embiggen a few NPCs, and do a teleportation effect with color fading screen effects . Pretty simple stuff.

I'll have to give this a try, I figured there was a way to do it, but I couldn't find it. I appreciate your prompt and helpful reply Smile
Metal King Slime
Send private message
 
 PostWed Nov 12, 2014 11:55 pm
Send private message Reply with quote
I don't think that triggering a script via npcs is going to work for this. You want to change the layering based on the direction the hero is facing, not what tile they just stepped on.

It's possible to change the order of map layers, and it sounds like that would be the best solution. There's no command to do that directly, instead you reorder the map slices. I've put up an article on this at How do I move or reorder a map layer?

You can use either a map autorun script or on-key-press script to update the layering (the map autorun script has the advantage that it works for movement due to script commands as well). So something like:

Code:
plotscript, update grass map 4, begin
  variable(walkabouts, layer)
  walkabouts := lookup slice(sl: walkabout layer)
  layer := lookup slice(sl: map layer 1)
  while (current map == 4) do (
    if (hero direction(me) == north || hero direction(me) == south) then (
      move slice above(walkabouts, layer)
    ) else (
      move slice below(walkabouts, layer)
    )
    wait(1)
  )
end
Slime Knight
Send private message
 
 PostThu Nov 13, 2014 2:56 am
Send private message Reply with quote
Thanks TMC, I'll see if I can get that script working for my maps with tiles that can be either above, or below the hero (probably a lot of trial and error considering my scripting skill)

I concede I have some degree of trouble with the scripting, but it's quite satisfying when you can finally get the game to do what you want!
Display posts from previous: