So, Heart of the OHR 2018 is over. A return to focus on
Entrepreneur: The Beginning has been ramping up (on Fridays and Saturdays). I think it's time for a new update.
Well, that is, assuming there is something to report.
In reality, there's been nothing new since the last update, which is nothing new from the update before that. Everything is about planning without any real proof of implementation. That's probably uneventful in the greater scheme of things. How many times have we been pitched an excellent idea and given a subpar implementation? Early Access is full of such atrocities.
But, what if I did have something to show of my months and years of hype? What if all this talk
has led to some kind of action?
Warning: Monster post ahead. Read only if you want to see how I took a chunk of scripting insanity and pared it down to something reasonable. (TMC, this is for you.) Also read if you want to take a stab at adding your own items to the game.
For the past couple of years, I've undergone a process to rewrite the game from pseudo-scratch (that's where you keep the same systems already established but rewrite how they work). A big part of that system rewrite is to change how items are implemented. Prior to the rewrite, this journal has infamously chronicled the lengthy steps I'd have to take to add just one new item (where adding a single item could take almost a day's worth of scripting, due to all of the hunting and modifying I'd have to conduct, based on a series of instructions I had to write to keep track of the process that is as similarly complicated as it is to building a desk chair from Office Depot, though not as easy to actually do). For the last few months, I've been improving on this system enough that adding a new item now takes just a few minutes.
It's an impressive turnaround in comparison, and I've decided that now is as good of a time as any to show you how the new item implementation works, as well as to feature all of the new things that the rewritten item structure can do. I was going to show you this some time ago, but that was before I made it better.
The Old Way versus the New Way:
First of all, it's important to mention that I've since scrapped my plan to focus all of item creation into a single script. I've tried it, and it ended up being almost as equally insane as splitting item development across 20+ channels. So, I broke item development into several categories. The new steps are as follows (for comparison, you can read my
previous list of steps to get a sense on what I had to overcome to get to this point):
1. I still have to define items in the items menu to give them a unique ID. I also still have to add four tags for consumables and five tags for equipment (under the prefixes, "have," "use," "shop," "item," and "sell," with the lattermost reserved for equipment only). I still have to assign global variables with the item's name, serving value (usually prefixed "serv"), and trending potential, if it's an item sold in stores, to track specific attributes throughout the game. I still have to assign each item a unique "trytobuy" ID to track acquisition habits (including those related to shoplifting). I still have to give each item a "compareitem" constant to use for trending (if it can be bought in stores). I still have to consider special case variables, like those attributed to items that can spoil. I still have to write textboxes that signal the item's existence in the game and menu selections that make highlighting it possible. These old steps can't be avoided. But, they also take hardly any time at all to implement. With the exception of textboxes, that's always been true.
2. What's changed is the scripting. Once I've defined the components, I can now
greatly reduce the steps required to implement them into the game. In fact, for any item that already has a template in place, the only thing I need to do to get the item up and running is to fill out a chart with its respective attributes defined. For items that don't yet have a template (like advertising items, for example, which are next on my list as of this writing), I may have to spend a little extra time determining what that template should be, but that, too, is on a system that's been pretty well streamlined.
3. Once the chart is filled out, I have to commit it to the game and assign the respective scripts to each item's location in CUSTOM.
And that's it. What's so great about this new system is that it can be infinitely customizable (not literally infinite, but customizable up to the point that I run out of global variables). If I want to create new attributes to each item, I just have to write the base formula and then apply it to the item's chart, or one of the special component scripts that are designated to handle add-ons. It's highly moddable in this respect.
Insanity Made Easy:
For example, let's examine how cinnamon powder is now defined in the game. Note that the following example is in-progress and may not reflect the final version. Some components are not yet fleshed out and will show a bunch of zeroes for now, but this will be addressed as I go through the next pass of item creation. I will also be substituting scripts and sections that do not affect cinnamon powder with a (#...) symbol or removing sections unrelated to cinnamon powder completely (not all, but some). Even though the new system greatly simplifies the process, it can still be intimidating to look at when viewed in its entirety. I'll explain each part under the posted code to give you a sense of what's happening here. Again, this is all WIP and can change before it's finalized.
Code: script,locate item,item,clr = true,begin
#needs a clear data script to prevent item corruption
#this "clear item data" needs to run before this script, but independently to prevent blocking outside flags.
if (clr) then(
clear item data
)
saveitemnumber := item
clear categories
switch (item) do(
case (0) read equipment item (@read coffeepot data, category:coffee)
#...
case (22) read garnish item (@read cinnamon powder data, category:flavor)
#...
)
true for all items
run new menu verification
saveitemnumber := 0
end
This is the hub script for all item manipulations. By accessing "locate item," I can call up all of its related stats and attributes and export it to a series of "general" variables that can be altered without damaging the item's core stats. This function is usually followed by a "write to item" command at the end of the manipulation script to confirm changes to the actual item.
Note: This is one of the only hub or template scripts I have to modify with each new item addition. One line! The case number is identical to the item's ID number defined in CUSTOM.
Code: script,clear categories,begin
menucat1 := 0
menucat2 := 0
menucat3 := 0
end
Every writable category needs a "clean" or "clear" script prior to the transfer process to prevent corruption.
Code: script,true for all items,begin
switch (persuasionlevel) do(
case (persuasion:low) do(
generalpersuasionneed := generalprice / 2
persuasionfloat := (generalprice * 50),mod,100
)
case (persuasion:average) generalpersuasionneed := generalprice
case (persuasion:high) do(
generalpersuasionneed := ((generalprice * 150) / 100)
persuasionfloat := (generalprice * 50),mod,100
)
case (persuasion:elite) generalpersuasionneed := generalprice * 2
case (persuasion:perfection) do(
generalpersuasionneed := ((generalprice * 250) / 100)
persuasionfloat := (generalprice * 50),mod,100
)
case (persuasion:impossible) generalpersuasionneed := 1000
case (persuasion:inevitable) generalpersuasionneed := 0
)
#add script for checking security levels or equivalent (which will require a shop value search)
generalshelfsafety := generalshelfspace--(generalshelfspace / 10)
end
Any statistic or function that is true for every item in the game will go into this script. This is basically a "set it and forget it" type of function. The only reason I would ever need to think about it is if I want to add another universal function to it or change the current behavior.
Code: script,run new menu verification,begin
if ((generalitem>=1) || (generalitemunit>=1)) then(
check item menu category (menucat1)
check item menu category (menucat2)
check item menu category (menucat3)
)
end
script,check item menu category, which, begin
switch (which) do(
case (category:coffee) menu subscriptions (2886, 2904)
#...
case (category:flavor) menu subscriptions (2889, 2921)
#...
)
end
These two script functions make it easier to script in-game menus and determine whether the item is visible in the menu (to prevent cluttering menus with items the player doesn't yet have). For example, any item tagged "category:flavor" will activate the menu tags 2889 and 2921 when the script detects that Buck has it in his inventory, allowing that menu to become selectable. This is designed primarily to keep me from having to constantly hunt for the right tag to match the right item to the right menu. Now all I have to do to get an item to appear in the proper menu is to assign it a category and make sure that category is defined.
Code: script,no allergies affected,begin
generalallergytype := allergy:none
generalallergyvalue := 0
generalallergytype2 := allergy:none
generalallergyvalue2 := 0
end
This is a "cleaner" script for allergies. It ensures that all items that activate allergies will require an allergy definition or two (which cinnamon powder will have, as you'll soon see). Items that do not trigger allergies need not worry about this function as it's already applied to them.
Note: Allergies will have three levels of intensity, as defined by the values. Customers will likely have their own "allergy tolerance" levels that will modify the allergy values so that a person with a strong tolerance will provide a low multiplier and those with a weak tolerance will provide a high multiplier (and those with no susceptibility will merely zero out the value).
Code: script,consignment category block equipment, string override = 0, text override = 2060,begin
consignment parameters (1, string override, 71, text override)
end
script,consignment category block items, string override = 0,text override 1 = 2062, text override 2 = 2063,begin
consignment parameters (2, string override, 70, text override 1, text override 2)
end
#...
script,consignment parameters,type = 0, str1 = 0, disp = 0, txt1 = 0, txt2 = 0,begin
itemtype := type
reporttype := type #refers to shop window displays (formerly consignmentreport) (for equipment)
consignmentstringsdisplay := str1
generalconsigntext := txt1
generalconsigntextaft := txt2
generalconsigndisplay := disp
end
The above section is a shell script that calls on text boxes and slice collections related to consignments.
Note: There are currently 15 consignment categories, but cinnamon powder uses category 2.
Code: script,consignment package type,pack = 0,begin
switch (pack) do(
case (0) item text (2060) #equipment (standard)
case (1) item text (2066, 2067) #individual unit
case (4) item text (2062, 2063) #bag
case (5) item text (2064, 2065) #bottle
#...
)
end
script,item text,txt1 = 0, txt2 = 0,begin
generalconsigntext := txt1
generalconsigntextaft := txt2
end
The above section determines how Sapphire, the consignment shop owner, responds to Buck's attempt to sell items. Her responses depend on the type of item it is.
Code: script,set category menus, cat1 = 0, cat2 = 0, cat3 = 0,begin
menucat1 := cat1
menucat2 := cat2
menucat3 := cat3
end
script,read equipment item, scr1, cat1 = 0, cat2 = 0, cat3 = 0, begin
itemisequipment := true
set category menus (cat1, cat2, cat3)
consignment category block equipment
equipment sub categories (cat1)
equipment sub categories (cat2)
equipment sub categories (cat3)
no allergies affected
run script by id (scr1)
end
script,equipment sub categories, which, begin
if (which == category:coffee) then(
itemiscoffeemachine := true
)
if (which == category:conversion) then(
itemisconversiondevice := true
)
if (which == category:electronics) then(
itemiselectronic := true
consignment category block depreciated items
)
if (which == category:storage) then(
itemisstorage := true
)
if (which == category:blender) then(
itemisblender := true
)
if (which == category:juicer) then(
itemisjuicer := true
)
if (which == category:cooking) then(
itemiscookingdevice := true
)
if (which == category:dispenser) then(
itemisdispenser := true
)
if (which == category:tea) then(
itemisteabrewer := true
)
if (which == category:broken) then(
itemisbroken := true
consignment category block broken equipment
)
if (which == category:modded) then(
itemismodded := true
consignment category block modified
)
if (which == category:moddable) then(
itemismoddable := true
)
if (which == category:refurbished) then(
itemisrefurbished := true
consignment category block fixed equipment
)
end
The above is an example of the category system, in this case for equipment. When the item data is cleared, all "itemis" attributes are set to "false." The category shell script sets "itemis" variables to "true" if that item falls into that category. Below is a sample of garnishes (like cinnamon powder, which is listed as "flavor") according to the categories system.
Code: script,read garnish item,scr1,cat = 0,begin
itemisgarnish := true
set category menus (cat)
if (cat == category:flavor) then(
itemiscoffeeflavoring := true
consignment category block items
consignment package type (4)
)
if (cat == category:dairy) then(
itemisdairy := true
itemcanspoil := true
consignment category block items
consignment package type (5)
generalallergytype := allergy:dairy
)
if (cat == category:preserved dairy) then(
itemisdairy := true
consignment category block items
consignment package type (7)
generalallergytype := allergy:dairy
)
if (cat == category:spoiled dairy) then(
itemisdairy := true
itemisspoiled := true
consignment category block trash
generalallergytype := allergy:dairy
generalallergytype2 := allergy:spoiled
)
if (cat == category:processed dairy) then(
itemisdairy := true
itemisprocessed := true
consignment category block processed
generalallergytype := allergy:dairy
)
if (cat == category:ice dairy) then(
itemisdairy := true
itemcanmelt := true
itemisfrozen := true
consignment category block items
consignment package type (15)
generalallergytype := allergy:dairy
)
if (cat == category:melted dairy) then(
itemisdairy := true
itemcanfreeze := true
itemismelted := true
consignment category block trash
generalallergytype := allergy:dairy
)
if (cat == category:chiller) then(
itemcanmelt := true
itemisfrozen := true
consignment category block items
consignment package type (4)
)
if (cat == category:liqueur) then(
itemisliqueur := true
itemisalcoholic := true
consignment category block items
consignment package type (120)
generalallergytype := allergy:alcohol
)
if (cat == category:perks syrup) then(
itemiscoffeebean := true
itemiscoffeeflavoring := true
itemisperk := true
consignment category block items
consignment package type (119)
)
run script by id (scr1)
end
Every category has a list of subcategories attached. Any new item I add that does not fall into an existing category will require that I add a new category. Any additional item I add that falls into this category will already have its respective "itemis" and consignment rules set.
Code: script,special consignment pricing instructions, fract = 0, cent = 0,begin
fractionprice := fract #for trash items only (number required to make a dollar on consignment)
centsprice := cent #for processed items only (nominator over item unit value)
end
This is for items found in trashcans or created through processing. Does not apply to cinnamon powder.
The next few scripts are shell scripts that transfer item-specific values to general variables. These are the values that I define on each item's definition page. This is what allows me to cut my item implementation time down from one day to a few minutes. I'll include every section here, even those that do not relate to cinnamon powder, but explain only those that may not be obvious by reading what they say. If you want more information on any of these topics, let me know.
Code: script,equipment parameter essentials, it = 0, eqset = 0, eqactive = 0, eqinuse = 0, eqbought = 0, eqsold = 0, ittrend = 0, itcomp = 0,begin
generalitem := it
generalequipset := eqset
generalequipactive := eqactive
generalequipinuse := eqinuse
generalequipdaybought := eqbought
generalequipdaysold := eqsold
generalitemtrend := ittrend
generalcompareitem := itcomp
end
script,trying to buy, reg = 0, post = 0,begin
generaltrytobuy := reg
generaltrytobuypost := post
end
script,equipment have use shop item sell tags, have tag = 0, use tag = 0, shop tag = 0, item tag = 0, sell tag = 0, begin
generalhaveitemtag := have tag
generaluseitemtag := use tag
generalshopitemtag := shop tag
generalitemtag := item tag
generalsellitemtag := sell tag
end
script,item parameter essentials, it = 0, servit = 0, ittrend = 0, itcomp = 0,begin
generalitem := it
generalitemunit := servit
generalitemtrend := ittrend
generalcompareitem := itcomp
end
script,item have use shop item tags, have tag = 0, use tag = 0, shop tag = 0, item tag = 0, begin
generalhaveitemtag := have tag
generaluseitemtag := use tag
generalshopitemtag := shop tag
generalitemtag := item tag
end
script,component object essentials, obset = 0, obcap = 0, obcur = 0, obfull = 0, obempty = 0, obinst = 0, begin
generalobjectset := obset
generalobjectcapacity := obcap
generalobjectcurrent := obcur
generalobjectfull := obfull
generalobjectempty := obempty
generalobjectinstalled := obinst
end
Note: "Component object essentials" are a new item type that refers to installed containers, like watercooler jugs.
Code: script,equipment shop settings, shop = 0, case id = 0, shop item id = 0, item price = 0, item shelf space = 0, item content capacity = 0, begin
if (current map == shop) then(
generalshopid := shop item id
generalprice := item price
generalshelfspace := item shelf space
shopcaseid := case id
dynamicshoplocation := shop
generalequipcapacity := item content capacity
)
end
Item capacity is a new value given to container items, like the watercooler jug. In the case for equipment, I believe I've set this to include serving capacities for coffeemakers and other equipment items.
Code: script,item shop settings, shop = 0, case id = 0, shop item id = 0, item price = 0, item quantity = 0, item shelf space = 0, item content capacity = 0, begin
if (current map == shop) then(
generalshopid := shop item id
generalprice := item price
generalinitialquantity := item quantity
generalshelfspace := item shelf space
shopcaseid := case id
dynamicshoplocation := shop
generalobjectcapacity := item content capacity
)
end
script,item trash settings, item price = 0, item quantity = 0, item shelf space = 0, begin
if (itemisused) then(
generalprice := item price
generalinitialquantity := item quantity
generalshelfspace := item shelf space
)
end
Note: The latter script, "item trash settings," is actually an all-purpose script to define all single-use, non-storebought items.
Code: script,item mean values, item price = 0, item quantity = 0, item capacity = 0, begin
meanitemprice := item price #useful info for consignments
meanitemquantity := item quantity
meanitemcapacity := item capacity
end
This function sets a universal price and quantity for selling items. This is important for when two or more shops sell the same item (like cream or milk) but sell it at different prices. The mean item price determines the base value that Sapphire will use when determining what to offer Buck at the consignment shop.
Code: script,special pawn conditions, pawn tag = 0, pawn type = 0,begin
generalpawnitemtag := pawn tag
generalpawntype := pawn type
end
script,item dimensions, itsiz = 0, itwt = 0,begin
itemsize := itsiz
itemweight := itwt
end
Even though this isn't in play yet, storage capacities will depend on item sizes and weights, as well as certain consignment values (like fruit and vegetables).
Did I mention that inventories will have limits soon?
Code: script,item prime texts, to buy = 0, acquire = 0, inv = 0, begin
originalitemtext := to buy
generalacqtext := acquire
generalitemtext := inv
end
These values are the textbox numbers for items based on shopping, acquiring, and viewing in inventory.
Code: script,equipment peripheral tags, plug = 0, filt = 0, begin
generalpluglocationtag := plug #this will be dynamic eventually
generalfilterdiscardtag := filt #this will change with multiple versions
end
This script is still fixed, but I'll be switching it to custom positioning soon. In other words, you won't have to put your coffeemakers where the game tells you to. You'll soon get to put your machines wherever you want. For now, the above script sets the tags that make the coffeemakers work. Has nothing to do with cinnamon powder.
Code: script,item temperature values, heat min = 0, heat max = 0, current heat = 0, begin
itembestheatminimum := heat min
itembestheatmaximum := heat max
itemcurrentheatvalue := current heat
end
Coming soon.
Code: script,item condition bonus stats, flav = 0, comf = 0, addic = 0, qual = 0, hlth = 0, lvl = 0, csb = 0, dol = 0,begin
generalitemflavor := flav
generalitemcomfort := comf
generalitemaddictive := addic
generalitemquality := qual
generalitemhealth := hlth
generalitemlevel := lvl
generalitemcsbonus := csb
generaladdadollar := dol
end
These are the values that modify coffee when a garnish, finisher, or essential is added. This feature extends to side items, fruits, etc. and will play a role in future crafting. "CS Bonus" refers to "customer service bonus" and "addadollar" is refers to a customer's mandatory tip.
Code: script,additional bonus special features, scene = 0, spc = 0, ent = 0, qual = 0, info = 0, csb = 0, begin
generalitemscenerybonus := scene
generalitemspecialbonus := spc
generalitementertainmentbonus := ent
generalitemspecialqualitybonus := qual
generaliteminformationbonus := info
generalitemspecialcsbonus := csb
end
These values apply to entertainment items like newspapers and radios.
Code: script, item flavor meter, sweet = 0, sour = 0, bitter = 0, earthy = 0, fruity = 0, acidic = 0, rich = 0, silky = 0, spicy = 0, salty = 0, choco = 0, meaty = 0, smoky = 0, eggy = 0, oily = 0, viney = 0, creamy = 0, woody = 0, wheaty = 0, nutty = 0, doughy = 0, moldy = 0, bubbly = 0, misc = 0,begin
generalitemsweetflavor := sweet
generalitemsourflavor := sour
generalitembitterflavor := bitter
generalitemearthflavor := earthy
generalitemfruitflavor := fruity
generalitemacidicflavor := acidic
generalitemrichflavor := rich
generalitemsilkflavor := silky
generalitemspicyflavor := spicy
generalitemsaltflavor := salty
generalitemcocoaflavor := choco
generalitemmeatflavor := meaty
generalitemsmokeflavor := smoky
generalitemeggflavor := eggy
generalitemoilyflavor := oily
generalitemvinegarflavor := viney
generalitemcreamyflavor := creamy
generalitemwoodyflavor := woody
generalitemwheatflavor := wheaty
generalitemnuttyflavor := nutty
generalitemdoughyflavor := doughy
generalitemmoldyflavor := moldy
generalitembubblyflavor := bubbly
generalitemmiscflavor := misc
end
script, item comfort meter, cool = 0, heat = 0, soft = 0, firm = 0, dry = 0, wet = 0, smooth = 0, velvet = 0, sharp = 0, carpet = 0, spongey = 0, prickly = 0, coarse = 0, sticky = 0, slimy = 0, cold = 0, hot = 0, tingle = 0, shock = 0, vibrate = 0, bubbly = 0, relief = 0, gross = 0, misc = 0,begin
generalitemcoolcomfort := cool
generalitemheatcomfort := heat
generalitemsoftcomfort := soft
generalitemfirmcomfort := firm
generalitemdrycomfort := dry
generalitemwetcomfort := wet
generalitemsmoothcomfort := smooth
generalitemvelvetcomfort := velvet
generalitemsharpcomfort := sharp
generalitemcarpetcomfort := carpet
generalitemspongecomfort := spongey
generalitempricklycomfort := prickly
generalitemcoarsecomfort := coarse
generalitemstickycomfort := sticky
generalitemslimycomfort := slimy
generalitemcoldcomfort := cold
generalitemhotcomfort := hot
generalitemtinglecomfort := tingle
generalitemshockcomfort := shock
generalitemvibratecomfort := vibrate
generalitembubblycomfort := bubbly
generalitempainreliefcomfort := relief
generalitemgrosscomfort := gross
generalitemmisccomfort := misc
end
The above two functions are a work in progress and will eventually define how flavor and comfort values are achieved. I will likely use the sums of these functions to determine the general flavor and comfort values in the "item condition bonus stats." For now, the values are arbitrary.
Code: script,item saturations, flav = 0, comf = 0, addic = 0, qual = 0, hlth = 0, lvl = 0, csb = 0, begin
#Note: These values seem to be affected during brewing. Best to leave them at zero for now.
generalitemoverflavor := flav
generalitemovercomfort := comf
generalitemoveraddictive := addic
generalitemoverquality := qual
generalitemoverhealth := hlth
generalitemoverlevel := lvl
generalitemovercsbonus := csb
end
This is the modifier given to any item that's used in saturation. This is typically a decadent modifier.
Code: script,item bonus display values,begin
append number (47,generalinitialquantity)
append number (27,generalprice)
display modification value shifts (28,generalitemflavor)
display modification value shifts (49,generalitemcomfort)
display modification value shifts (42,generalitemaddictive)
display modification value shifts (43,generalitemquality)
display modification value shifts (44,generalitemhealth)
display modification value shifts (29,generalitemcsbonus)
append number (45,generalitem)
append number (46,generalitemunit)
end
script,item null display values,begin
append number (47,generalinitialquantity)
append number (27,generalprice)
$28="n/a"
$49="n/a"
$42="n/a"
$43="n/a"
$44="n/a"
$29="n/a"
append number (45,generalitem)
append number (46,generalitemunit)
end
These two scripts read the bonus modifiers and display them in shops when the player selects an item for purchase (or for consideration of purchase).
The next section I'm omitting from this report because it's focused entirely on equipment items and I want to keep this from getting too complex to read. I may do a separate feature on equipment if there's any interest.
Code: script,altered state meta check, which = 0, begin
#The following section refers to special metadata for broken and trash items, as well as unique social and moddable items.
#These won’t apply to most store-bought items.
#I need to decide if I want a broken subcategory, or just make broken items their own item.
switch (which) do(
#...
case (compareitem:cream) do(
dairy spoil conditions (creamspoil, goodcream1, spoiledcream, 494)
)
case (compareitem:milk) do(
dairy spoil conditions (milkspoil, goodmilk1, spoiledmilk, 495)
)
#...
)
end
#...
script,dairy spoil conditions, tospoil = 0, gooditem = 0, spoil version = 0, spoil tag = 0, begin
itemtospoil := tospoil
generalgooditem1 := gooditem
generalspoileditem := spoil version
spoileditemtag := spoil tag
end
The "altered state meta check" is used to store data for items that may have more than one form. Cinnamon powder does not have an altered state, but coffee beans (powder), dairy items (perishable), pastries (stale), etc. do. Equipment items may also fall into this category. The purpose of this script is to isolate special cases from the main item data sheets so that I don't lose track of them.
Code: script,overabundances,begin
#toosweet - for sugar
#toorich - for cream (all types)
#toosaturated - for milk (all types)
#toothick - for ice cream
#toosandy - for cinnamon
#toobitter - for powdered grass and old salt
#toonasty - for spoiled garnishes
#toostrong
#toospicy
#toocold
#toohot
#tooboring
#Note: This section connects to “Check Garnishing Tray.”
#I may want to redo how this works, especially with the customer response texts.
#if (itemisgarnish) then(
# generaloverabundance := toosandy
# $56="Too Sandy!"
#)
end
In-progress script for determining the outcomes of coffee (and maybe other future crafted items) that have been saturated or otherwise deemed unpleasant.
Code: script,dynamic shopping conditions,begin
#This section is for dynamic shopping
#Update to shopcaseid if this section is independent of shop scripts
dynamicitemisvalid := false
switch (generalshoplocation) do(
case (dynamicshoplocation) do(
if (generalshopitem == shopcaseid) then(
dynamicitemisvalid := true
)
)
)
end
A "set it and forget it" script that affects shop inventories when dynamic shoppers purchase items. For items that cannot be bought in stores (like trash and processed items), the function "dynamicitemisvalid := false" will run in its place.
Code: script,display modification value shifts, str = 0, value = 0,begin
clear string (74)
if (value >> 0) then(
$74="+%d"
)
else(
$74="%d"
)
string sprintf (str,74,value)
end
This script goes with shop displays, used in the "item bonus display values" function listed a few lines above.
Code: script,record item special case, case = 0, attrib = 0,begin
itemspecialcase := case
specialattribute := attrib
end
This is used for items that apply a special designation to a crafted item if used. All toppers (stirrers, cup warmers, and now even cinnamon powder, as of the upcoming version) will use this function.
Code: script,allergies affected, alg1 = 0, algval1 = 0, alg2 = 0, algval2 = 0,begin
generalallergytype := alg1
generalallergyvalue := algval1
generalallergytype2 := alg2
generalallergyvalue2 := algval2
end
Used to assign allergy types and degrees of intensity to items. For example, peanut butter affects "allergy:peanuts" at an intensity of 2. Some items, mostly pastries, contain more than one allergy category. Woe to the customer who has low tolerance and is allergic to both ingredients in said item.
Additional scripts for yard equipment and health items have been omitted from this report.
Code: script,object name string, whichmain = 0, whichartc = 0, whichhold = 0, whichsub1 = 0, whichsub2 = 0, whichabbr = 0, scr = 0, begin
if (specialtextdisplay) then(
copy string (9, whichmain) #$9="Store Powder"
copy string (57, whichartc) #$57="is"
)
if (itemisholdover) then(
copy string (30, whichhold) #$30="Store Powder"
)
if (checktag (2203)) then( #prep item reports
copy string (11, whichsub1) #$11="Store Powder" (may need new string)
copy string (12, whichsub2)
)
#This section is for shop display slices (equipment)
if (checktag (2203)==false) then(
if (itemwindow1) then(
copy string (12, whichmain) #$12="Store Powder"
shopping item rewrite strings (generalcompareitem)
)
if (itemwindow2) then(
copy string (12, whichmain) #$12="Store Powder"
if (scr<>0) then(
run script by id (scr) #item bonus display values
)
)
)
#for end of day trends reporting
if (checktag (2637)) then(
copy string (2, whichmain) #$2="Store Powder"
)
#for standard shopping cart windows (consult old “record list,cur” for comparison strings)
if (checktag (2638)) then(
copy string (2, whichabbr) #$2="S.Powder x"
)
end
This is the shell script that copies item name strings to various slice and text displays.
Code: script,finisher interactive text, conv1 = 0, conv2 = 0, begin
conversiontext1 := conv1
conversiontext2 := conv2
end
This is how Buck responds to using finishers (stirrers, cup warmers, etc.). Works in conjunction with "record item special case."
And those are some of the formulas and shell scripts I use to help me keep control of new item additions.
The Item Sheet:
And now it's time for the main event, the item sheet. Note that this is the main script out of three that must be written from scratch or modified from a template to get an item into the game. The other two essential scripts are "locate item" (listed at the top of this post) and "write to item" (not featured in this post, but is essentially a shorter reversal of the item sheet listed below, used to transfer general data back to the item).
Note: For special or converted items, "altered state meta check" is also important.
Code: script,read cinnamon powder data,begin
generalitemid := 22
item mean values (30, 50)
multiplelocations := true
item parameter essentials (
cinnamon,
servcinnamon,
cinnamontrend,
compareitem:cinnamon
)
trying to buy (trytobuy23, trytobuy23post)
item have use shop item tags (141, 142, 56, 25)
item shop settings (4, 8, groceritem8, 30, 50, 100) #shop, item id num, item id var, price, quantity, stock, capacity
item shop settings (27, 75, sassyitem75, 32, 50, 100) #shop, item id num, item id var, price, quantity, stock, capacity
item prime texts (119, 93, 47) #to buy, acquire, inventory
item dimensions (0, 0) #size, weight
item temperature values (0, 0, 0) #best heat min, best heat max, current heat
item condition bonus stats (2, 0, 0, 0, 0, 1, 0, 0) #flavor, comfort, addictive, quality, health, level, cs bonus, add a dollar
item flavor meter (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) #sweet, sour, bitter, earthy, fruity, acidic, rich, silky, spicy, salty, choco, meaty, smoky, eggy, oily, viney, creamy, woody, wheaty, nutty, doughy, moldy, bubbly, miscellanous
item comfort meter (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) #cool, heat, soft, firm, dry, wet, smooth, velvet, sharp, carpet, spongey, prickly, coarse, sticky, slimy, cold, hot, tingle, shock, vibrate, bubbly, pain relief, gross, miscellanous
item saturations (-2, 0, 0, 0, 0, 0, 0) #flavor, et al.
combobonusactive := false
altered state meta check (generalcompareitem)
special consignment pricing instructions (0, 0) #fraction, cent
#Shopping
$9="Cinnamon Powder" #special text display item
$57="is" #special text display article
$30="Cinnamon Powder" #holdover info
$11="Cinnamon" #prep item report a
$12="Powder" #prep item report b
$2="Cinnamon x" #shopping list
object name string (9, 57, 30, 11, 12, 2, @item bonus display values)
overabundances
dynamic shopping conditions
allergies affected (allergy:cinnamon, 2)
record item special case (cinnamonspiced, attribute:quality)
finisher interactive text (5147, 5148)
end
As you can see, forming items through a standard worksheet is so much faster and easier than doing so through a series of 20+ individually handcrafted sections. While each item type may have its own set of parameters (for example, coffee beans may have an additional function for powder conversions), the universal attributes (cost, bonus, IDs, etc.) can be easily tracked, modified, and implemented. This means that any item modification I make, like deciding that all powders are flammable, for example, can also be quickly implemented.
If all goes well, I can also use this system to make everything into a coffee garnish, for better or for worst, with a few more adjustments. Ever wanted to see what would happen if you put bananas in your coffee? Yeah, me, too.
I still have about half of the 300 series of items to implement, which includes advertising, electronics, and office items, and all of the 400 series of items (right now, there are 12, and they're all pastries). When that's done, I need to go back and fill in some of the zeroed items like height, weight, temperature, and exact flavors and comfort levels, as well as most of the altered state values. Then I need to finish my consignment categories (I've got one or two left to define), turn previously arbitrary items like teddy bears and videocassettes into actual defined items, possibly pushing me into the 500 series of items, complete the "write to item" section, and then finish checking my various shop, consignment, and pavilion formulas to make sure everything will work and make the necessary adjustments. By then, I should be ready to package the next experimental release, 1.2.2.
Hopefully production will start going faster after that. Exciting, right?
By the way, the 10th anniversary of me beginning this madness happens on May 12th. Mark your calendars.
Place Obligatory Signature Here