Wednesday, March 28, 2012

Guide - Streets


Lets do something a little different and look at adding streets. Pretty simple to tell you the truth and a lot of fun. Streets right now go left or right with down always heading back to home. This might change with a little more flexibility later on but right now its just not needed.

First off location

libs/otherlib/xml/town/

and to add another street file just add it to

libs/otherlib/xml/town/townfiles.xml

Lets look at the top level part of the street xml. Pretty simple here if the street goes no where in a direction leave it at none.

label = "redlightstreet" --- The name of the street that is searched for
bg = "redlight.png" --- the image used as the background
banner = "banner/RedLightStreetBanner.png" --- the image used for the top right hand corner
right = "main" --- if the right button is pressed what street do we go to / label
rightbutton = "button/mainstright2.png" -- the image for the street to the right
left = "none" --- goes no where does nothing
leftbutton = "" --- no image goes nowhere does nothing
info = "mainstreetinfo" --- the event that happens when you press the street info button (the center button in the navigation)

That's it for the top level now just to add the buttons. If anything these are even simpler.

label = "redlips" --- name of the store
open = "RedLipsButton.png" --- if it's open display this button
closed = "RedLipsNightButton.png" --- if it's closed show this one
morning = "closed" --- open / closed during this time
afternoon = "closed" --- open / closed during this time
evening = "open" --- open / closed during this time
night = "open" --- open / closed during this time
side = "right" --- display the button on the right or left side
beforeevent = "redlipsoutside" --- you can now add events before the player enters the shop

Notes on beforeevents... shops are now built by going through the event system. Leaving beforeevents out or "" will result in the shop opening with no event triggered or required by builder. This works with evekey label = "shop" arg1 = "shoplabel" arg2 = "front" arg2 defaults to front and if you leave it out the first room in a shop must be front. arg1 defaults to the last shop pressed.


That's it. Can it be any easier? If you have questions leave a comment.

edit
-- 4/18/12 added beforeevents

Daisy

1 comment:

  1. Question : when do you think you can release the next update ?

    ReplyDelete