Saturday, March 31, 2012

Guide - Shops

Shops are rather simple to set up but they can call a large number of events depending on how you want to make them. This should allow easy quest building but if you feel that a feature or event call is missing please tell me and I will happy add it.

So like everything we should start off with where the files are...

libs\otherlib\xml\shop\

to add new files it is

libs\otherlib\xml\shop\shopfile.xml

images should be in the

libs\otherlib\images\shop

No real surprises there.

The top level of a shop has only 2 commands... why because all the rest are part of a room.

startroom = "front" --- room that is first seen when entered.
label = "accessoryshop" --- the label called when entered

That's it for those. Someone pressed the street button calling the label and once the label is found it goes to the room listed.

Rooms have a lot of odd ball commands to help with events that are created by the room such as not enough money etc. Also rooms can be just about any type of shop you want including a blacksmith, a realestate office, housing etc.

-----------------Movement-------------------

label = "front" --- The name of the room
up = "something"  -- where the button goes
upbutton = "buttonimage" --- the upbuttonimage
upevent = "something"    -- fire an event rather then go stratight to a new room leaving out or empty will just mean it goes straight to the room in label.
left = "none" --- pressing the button to the left will go to this room in the shop or street!
leftbutton = "#none" -- the picture for the left button, yes image replace works too
leftevent = "something"    -- fire an event rather then go stratight to a new room leaving out or empty will just mean it goes straight to the room in label.
right = "none" --- pressing the button to the right will go to this room in the shop or street!
rightbutton = "#none" -- the picture for the right button, yes image replace works too
rightevent = "something"    -- fire an event rather then go stratight to a new room leaving out or empty will just mean it goes straight to the room in label.
down = "mainstreet" --- pressing the button to the down will go to this room in the shop or street!
downbutton = "town/button/town.png" --- the picture for the down button, yes image replace works too
downevent = "something"    -- fire an event rather then go stratight to a new room leaving out or empty will just mean it goes straight to the room in label.

------------------------ Basic Commands ----------------------

info = "accessoryshopfrontinfo" --- the even if the info button is pressed
bg = "shop/accessoryshop/accessoryshop.jpg" -- the back ground image
buy = "true" -- Show the buy window and add items to buy
sell = "true" --- show the sell window and add player items
entryevent = "eventname" --- event that fires when the room is opened
peirce = "false" --- can you peirce at the shop?
carpenter = "false" --- Is this a carpenter shop?
realestate = "false" --- Is this a real estate shop?

-----------------------Frames --------------------------------

frame = "shop/redlipsstripclub/testframe.png"  -- image used as the back ground of the frame
framex = :5"   ---- x loc of name relative to top right corner  950 + st.roomFrameX
framey = :5"   ---- y loc of name relative to top right corner 60  + st.roomFrameY.

frameh = :5"   ---- height has a relative of 50  + st.roomFrameH
framew = :5"   ---200  + st.roomFrameW
name = "Entrance"  --- text put in the frame can leave out if its one solid image using frame
namecolor = "#FFFFFF" --- color of the name text in frame has a default of white
namefont = "22" --- font size defaults to 22
namex = :5"   ---- x loc of name relative to top right corner 1000 + st.roomNameX
namey = :5"   ---- y loc of name relative to top right corner 67  + st.roomNameY.
nameh = :5"   ---- height has a relative of 40  + st.roomNameH
namew = :5"   --- 150  + st.roomNameW
-----------------Buy Sell Options -----------------------


spokesman = "#utau" --- The person who is selling the items, uses name replace from textsystem
spokesmanimage = "#utau" --- the persons image uses image replace from textsystem or direct link
sellfail = "" --- this is the event text if the sell failed
markupbuy = "accessorymarkupbuy" -- adds to the price, not functional
markupsell = "accessorymarkupsell" --- decreases sell value, not functional
producer = "Accessory Shop" --- adds this text as the producer when an item is purchased.
setsort = "tattoo" --- you can set the sort box to default to this choice. If blank will go to "all"

--------------- Tattoo Commands ----------

allreadytattoo = "someevent" --- an event if you try to tattoo a girl who already has one.

--------------- pierce commands -----------

cpierce = "jewelryshopcpierce" --- an event that is run on successful clit pierce
npierce = "jewelryshopnpierce" --- an event that is run on successful nipple pierce
epierce = "jewelryshopepierce" --- an event that is run on successful ear pierce
fpierce = "jewelryshopepierce" --- an event that is run on fail pierce

--------------- Carpenter commands ---------

carpenterrequired = "someevent" --- error message if the player tries to remove a required room.

--------------- Real Estate commands --------

markupbuy = "" --- not used at this time
roomMarkUpSell - "" --- not used at this time

That's it for the room command level but each room can actually have even more commands. Items for the shops, and buttons for events.

-------------- Sorting -----------

Sorting displays all items with the tag listed in the sort. It's really that simple. For most shops they will probably sell more then one type of sorted item and that is fine.

sorter type = "ear left"
sorter type = "ear right"
sorter type = "ring left"
sorter type = "ring right"

------------- Buttons --------------

The great thing about buttons is that they wait for input and then when they receive input they trigger an event. This gives HUGE modding advantages as you can have the user triggering events outside of jobs and there easy to add.

label = "jewelryshopdefault" --- the event call
image = "#defaultbutton" --- the button image most of the time the #defaultbutton is fine
text = "Talk - Sugar" --- text displayed to float over the button may want to leave blank if your doing a custom button
side = "left" --- display the button on the left or right side of the screen
fontsize = "24" --- size of the button's text...

So now that we have it all together I just want to point out with the room system is possible to have a normal shop and in the next room a black market shop selling completely different things or even different houses. And with the buttons you can have different events firing at any time.

Last but not least I forgot to mention but there is an event that fires upon entering a shop and its the shop's label. That will probably give people some bugs... since even if you don't want anything to happen you have to make an empty event.

If a feature is missing and needed please tell me these are a work in progress and more work can be done on them. Lots of potential options that are doing nothing or not added at this time and I will fix that as needed.

---Updates

4/21/12 --- added frames, names and events

Daisy

No comments:

Post a Comment