|
Furcadia Links: Furcadia Site Furcadia Forums Downloads: Graphite's PatchMerger Furcadia Historical Society ![]() |
DragonSpeak
Systems
"Barebones Database Tracking" Based on the Tracking
System originally created by Carrie O'Kaye I have stripped some of the
more complicated and confusing components in hopes it will make
how you do it and what is
happening in the DS just a little bit clearer.
This script can actually be copied and pasted and run on it's own, but know that there are alot of actions it doesn't support. This is basically a script for beginners to use in hopes it will help them get a better understanding of how a data is managed and can be applied to a dream. Download This DS with a map template. Take note this stat DS was written before v4.0 (Entry codes, walls, etc.) My current dream is still built upon this with the addition of some Entrycode DS as a "Safety Net" that corrects most errors within 1 second. DSPK V03.00 Furcadia New Dragonspeak Script Created by Nommad based on the ideas and concepts of Carrie O'kaye *========= Bare Bones Database DS =============== *by Nommad based on the ideas and concepts of Carrie O'kaye *First Thoughts: What is a database? The database stores numbers, Through the DS and variable definitions, you make these numbers mean something. *You store these %variables (numbers) through floor numbers and object numbers. Where you store these items expands on what the number means or it's definition. *At start up define the areas you will use as data storage through floor and objects numbers. (0:0) When everything is starting up, *this area I use column 2,30 - 2,190 for ID tracking (3:4) within the rectangle (#0,#0) - (#4,#199), (5:1) set the floor to type #0. (5:4) place object type #0. *this area I use for data storage (3:4) within the rectangle (#180,#0) - (#208,#199), (5:1) set the floor to type #0. (5:4) place object type #0. *set notFound variable (5:500) set variable %notFound to the X,Y position of a random spot within the rectangle (0,0) - (0,0). *======== ID Tracking ===================== *Second Thoughts: How do I track? Tracking can be done through the unique object system... * (1:1002) and they are holding item # in their paws, but can be tedious. *If you can use the x,y column tracking method and assign a Number to the player you can store variables into that database entry. *How do I assign an ID Number? We need to find some numbers that already exist on the map that we can assign.... *x,y numbers should work well as they define specific locations on the map... *Using Columns (x) and Rows (y) we can assign IDs 2,4,6,8... along the Row, or IDs 1,2,3,4... Down a Column.... So I'll assign ID numbers down the .x=2 column using the .y numbers. Note it can be done either way. *So you now have ID numbers to assign to players = %ID.y *There are several different ways to assign IDs, I prefer the method where a person without an ID is forced to an entry area and must "initialize" and ID. *Define an entry point / ID "not found" area. *example: * (3:4) within the rectangle (#14,#10) - (#30,#24), *So dream entry is into this area... (0:9) When a furre arrives in the dream, (5:15) move the triggering furre to (#22,#18), or to someplace nearby if it's occupied. (5:200) emit message {<b>BareBones Database DS</b> <i>by Nommad</i>.} to whoever set off the trigger. (5:200) emit message {In this example you can say NEW to create and ID or simply move from the entry area to the dream area to have IDs auto Assigned.} to whoever set off the trigger. (5:200) emit message {Say ? for Testing Commands.} to whoever set off the trigger. (5:200) emit message {Website:<a href=http://spiritwind.gamepsychos.com/dreams/index.html>Nommad's Dreamsite <a href=http://spiritwind.gamepsychos.com/forum/index.php>Dream/DS Forums</a>} to whoever set off the trigger. (5:30) play midi #2 to whoever set off the trigger. *note that entry is not yet tracking, teleports that must track have to be handled carefully. *Initialize ID Variables (0:30) When a furre says anything, *define some locations... specifically YOUR location for Tracking. (5:350) set variable #%player to the X,Y position the triggering furre (moved from/is standing at). *How does it track? *By matching the furre's location with thier ID in the Index. However Assigning an ID must come AFTER the tracking of an ID. *Now the DS has to track every action that will change the furre's location. This is the "Heart" of Carrie O'kaye's Tracking system: *These are just the basic Actions. Any action that might effect the tracking or data variables must also be present. *These basics will cover moving into an object or using an object. *However, if you want picking up and object or dropping an object to effect stats each instance (object) must be included here, the override section and close data section. *example *(0:17) When somebody picks up object type #2, *(0:17) When somebody picks up object type #3, *(0:18) When somebody drops object type #2, *(0:18) When somebody drops object type #3, (0:10) When a furre leaves the dream, (0:30) When a furre says anything, (0:1) Whenever somebody moves, (0:16) When a furre uses any object, (0:71) When a furre stays in the same square for #1 seconds, (5:350) set variable #%furPos to the X,Y position the triggering furre (moved from/is standing at). (5:351) set variable #%furToPos to the X,Y position the triggering furre moved to. (3:4) within the rectangle (#2,#0) - (#2,#198), (4:3) only where an object type #%furPos.x is, (4:1) only where the floor is type #%furPos.y, (4:4) only where there is no object type 0, (5:4) place object type #1002 (5:301) copy the value of variable %notFound into variable %furIndex. (5:530) set variable %furIndex to the X,Y position of a random spot where the object is type 1002 within the rectangle (2,0) - (2,198). (4:0) clear all filtering, (3:2) at position (#%furIndex ) on the map, (5:5) change object type #1002 to type #%furpos.x. *include opening the ID database In this case 1 column (x180) that can store 2 variables... one with the floor # one with the object # at (180,%furIndex.y) (5:380) set variable #%data1 to the floor type at (#180, #%furIndex.y). (5:381) set variable #%data2 to the object type at (#180, #%furIndex.y). *the variables %data1, %data2 can be anything you want them to be. It's best to edit them so that the variable name reflects what the variable represents. *Such as %hp and %gold, %food and %water, etc. They are just numbers that represent something you dream up. *To track and store more data use the same idea with the additional columns 182, 184, etc. etc. *======== Assigning an ID ========================= *Note actual creation needs to come after tracking (0:31) When a furre says {new}, *prevent characters with IDs from changing IDs (1:200) and variable #%furIndex is equal to #0, *be sure they can't create a new character anywhere but in the entry area. (1:80) and the triggering furre is within the rectangle (#14,#10) - (#30,#24), (0:2) When somebody moves into floor type #168, *prevent characters with IDs from changing IDs (1:200) and variable #%furIndex is equal to #0, *be sure they can't create a new character anywhere but in the entry area. (1:80) and the triggering furre is within the rectangle (#14,#10) - (#30,#24), *find and open ID number to assign using the x column in this example I am using column 2 and reserving rows 0-30 and 190-198. (5:530) set variable #%furIndex to the X,Y position of a random spot where the object is type #0 within the rectangle (#2,#30) - (#2,#190), *mark furre's location at the ID by using the x and y of the variable %player to begin tracking (3:2) at position (#%furIndex) on the map, (5:1) set the floor to type #%player.x. (5:4) place object type #%player.y. *reset data (5:300) set variable #%data1 to the value #100. (5:300) set variable #%data2 to the value #0. (5:200) emit message {ID %furIndex.y Created!} to whoever set off the trigger. (5:200) emit message {HP: %data1 / Gold: %data2} to whoever set off the trigger. *========= Testing/Spoken Commands to manipulate data ========= (0:31) When a furre says {?}, (5:200) emit message {Test Commands to set data are SET, ADD, SUBTRACT, MULTIPLY, DIVIDE : HP or GOLD} to whoever set off the trigger. *Test Commands (0:32) When a furre says something with {set} in it, (0:32) When a furre says something with {add} in it, (0:32) When a furre says something with {subtract} in it, (0:32) When a furre says something with {multiply} in it, (0:32) When a furre says something with {divide} in it, (5:314) set variable #%set to the number the triggering furre just said. (5:200) emit message {Take note that Furcadia cannot properly handle numbers much higher than 32000!} to whoever set off the trigger. (0:32) When a furre says something with {set hp} in it, (5:300) set variable #%data1 to the value #%set. (0:32) When a furre says something with {add hp} in it, (5:302) take variable #%data1 and add #%set to it. (0:32) When a furre says something with {subtract hp} in it, (5:304) take variable #%data1 and subtract #%set from it. (0:32) When a furre says something with {multiply hp} in it, (5:306) multiply variable #%data1 by #%set. (0:32) When a furre says something with {divide hp} in it, (5:308) divide variable #%data1 by #%set and put the remainder in variable #%trash. (0:32) When a furre says something with {set gold} in it, (5:302) take variable #%data2 and add #%set to it. (0:32) When a furre says something with {add gold} in it, (5:302) take variable #%data2 and add #%set to it. (0:32) When a furre says something with {subtract gold} in it, (5:304) take variable #%data2 and subtract #%set from it. (0:32) When a furre says something with {multiply gold} in it, (5:306) multiply variable #%data2 by #%set. (0:32) When a furre says something with {divide gold} in it, (5:308) divide variable #%data2 by #%set and put the remainder in variable #%trash. ======== Normal DS ================= *Main Body of DS goes here *Take note that any Teleports or "Move Furre Back to where they moved from" will break the Tracking! *Samples of how to do Teleports are in the Teleport Section (0:31) When a furre says {+}, (0:31) When a furre says {stats}, (5:200) emit message {ID: %furIndex.y} to whoever set off the trigger. (5:200) emit message {Location: %player.x , %player.y} to whoever set off the trigger. (5:200) emit message {HP: %data1 / Gold: %data2 } to whoever set off the trigger. *examples of moving into an object effecting stats example (0:3) When somebody moves into object type #37, (5:302) take variable #%data2 and add #10 to it. (5:200) emit message {You gain 10 gold, you now have %data2 gold.} to whoever set off the trigger. (0:3) When somebody moves into object type #38, (5:302) take variable #%data1 and add #10 to it. (5:200) emit message {You gain 10 hp, you now have %data1 hp.} to whoever set off the trigger. (0:3) When somebody moves into object type #39, (5:304) take variable #%data1 and subtract #10 from it. (5:200) emit message {You lose 10 hp, you now have %data1 hp.} to whoever set off the trigger. ========= End Main Body of DS ====== ============================== Tracking Fix / Checks / Overide / Swapping *I use this section to include any action that might break tracking *these are the basic actions that should be placed here. (0:1) Whenever somebody moves, (1:5) and they successfully moved, (5:41) place object type %furToPos.x at (%furIndex ). (5:40) set the floor to type %furToPos.y at (%furIndex ). (0:1) Whenever somebody moves, (1:105) and they were blocked from moving (or stood still), (0:16) When a furre uses any object, (0:30) When a furre says anything, (0:36) When a furre says or emotes anything, (0:71) When a furre stays in the same square for #1 seconds, (5:41) place object type #%furPos.x at (%furIndex ). (3:2) at position (%furIndex ) on the map, (5:1) set the floor to type #%furPos.y. ========= Teleports and Any Actions that would change a Furre's location and break tracking should go here ===== *note that with teleports you must be able to place the proper x,y object and floor to maintain ID tracking *spoken teleport example specific location (0:31) When a furre says {start}, *a condition is essential to determine if teleport is possible and prevent placement of x,y tracking (1:1101) and there's no furre at (#22,#18), *move into a object for teleport (0:3) When somebody moves into object type #156, *a condition is essential to determine if teleport is possible and prevent placement of x,y tracking (1:1101) and there's no furre at (#22,#18), *move into a location (0:7) When somebody moves into position (#30,#34), *a condition is essential to determine if teleport is possible and prevent placement of x,y tracking (1:1101) and there's no furre at (#22,#18), (5:14) move the triggering furre to (#22,#18) if there's nobody already there. *the furre's new x location (5:41) place object type #22 at (#%furIndex). *the furre's new y location (5:40) set the floor to type #18 at (#%furIndex). (5:200) emit message {Direct Teleport to 22,18} to whoever set off the trigger. *my system for "somewhere nearby" type teleports *can be applied to spoken, object, locations *first have DS set a random location in the teleport area (0:31) When a furre says {warp}, (0:3) When somebody moves into object type #1326, (5:530) set variable #%warpto to the X,Y position of a random spot where the object is type #0 within the rectangle (#14,#10) - (#30,#24), *then check to make sure it is a valid location (0:31) When a furre says {warp}, (1:1101) and there's no furre at (#%warpto), (0:3) When somebody moves into object type #1326, (1:1101) and there's no furre at (#%warpto), (5:14) move the triggering furre to (#%warpto) if there's nobody already there. *the furre's new x location (5:41) place object type #%warpto.x at (#%furIndex). *the furre's new y location (5:40) set the floor to type #%warpto.y at (#%furIndex). (5:200) emit message {Variable or Somewhere nearby Teleport} to whoever set off the trigger. *Special Note if you're using Hitpoints and Life use the same type teleport for Death (0:1) Whenever somebody moves, *you must include this condition so people entering the dream and people in the entry area are not effected (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), *data1 in this example represents hitpoints (1:202) and variable #%data1 is less than #1, (0:16) When a furre uses any object, *you must include this condition so people entering the dream and people in the entry area are not effected (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), *data1 in this example represents hitpoints (1:202) and variable #%data1 is less than #1, (0:71) When a furre stays in the same square for #1 seconds, *you must include this condition so people entering the dream and people in the entry area are not effected (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), *data1 in this example represents hitpoints (1:202) and variable #%data1 is less than #1, (5:530) set variable #%warpto to the X,Y position of a random spot where the object is type #0 within the rectangle (#14,#10) - (#30,#24), (0:1) Whenever somebody moves, *you must include this condition so people entering the dream and people in the entry area are not effected (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), (1:202) and variable #%data1 is less than #1, (1:1101) and there's no furre at (#%warpto), (0:16) When a furre uses any object, *you must include this condition so people entering the dream and people in the entry area are not effected (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), (1:202) and variable #%data1 is less than #1, (1:1101) and there's no furre at (#%warpto), (0:71) When a furre stays in the same square for #1 seconds, *you must include this condition so people entering the dream and people in the entry area are not effected (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), (1:202) and variable #%data1 is less than #1, (1:1101) and there's no furre at (#%warpto), (5:14) move the triggering furre to (#%warpto) if there's nobody already there. *the furre's new x location (5:41) place object type #%warpto.x at (#%furIndex). *the furre's new y location (5:40) set the floor to type #%warpto.y at (#%furIndex). (5:200) emit message {You have Died!} to whoever set off the trigger. *note that you need to reset HP so the furre doesn't get into a "death loop" (5:300) set variable #%data1 to the value #100. *this command comes after all other Dream DS but before Error Checks and Closing Data, note that it can sometimes cause an idle furre to become invisible until they move or are bumped into. (0:71) When a furre stays in the same square for #1 seconds, (5:18) move the triggering furre back where they came from. ========= ID Not Found ===================== *Force player back to Entry Area if ID is not found... (0:30) When a furre says anything, (1:200) and variable #%furIndex.y is equal to #0, (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), (0:16) When a furre uses any object, (1:200) and variable #%furIndex.y is equal to #0, (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), (0:1) Whenever somebody moves, (1:200) and variable #%furIndex.y is equal to #0, (1:180) and the triggering furre is not within the rectangle (#14,#10) - (#30,#24), (5:15) move the triggering furre to (#22,#18), or to someplace nearby if it's occupied. (5:200) emit message {Tracking Error, you must Initialize Tracking.} to whoever set off the trigger. (5:200) emit message {Say NEW to create an ID.} to whoever set off the trigger. *=== Basic ID Management ====== *This section will reopen an unoccupied ID (0:100) When #1 seconds have passed, offset by #0, (5:540) set variable #%onlinefurre to the X,Y position of a random spot where the object is not type #0 within the rectangle (#2,#33) - (#2,#189), (5:381) set variable #%onlinex to the object type at (#%onlinefurre). (5:380) set variable #%onliney to the floor type at (#%onlinefurre). (0:100) When #1 seconds have passed, offset by #0, (1:206) and variable #%onlinex is not equal to #0, (1:1101) and there's no furre at (#%onlinex,#%onliney), (3:2) at position (#2,#%onlinefurre.y) on the map, (5:1) set the floor to type #0. (5:4) place object type #0. *include for "spam" free testing... sit/stand on an object (10) to hear emit for testing * (4:3) only where an object type #10 is, * (5:201) emit message {Spirit %onlinefurre.y not found: Index Cleared.} to any furre present. *=== Close DataBase ======== *Saves and Updates any changes to the data through the DS. *for example if %data1 was gold and at some point in the DS you have : * (5:302) take variable #%data1 and add #5 to it. *it opened data1 when the action started and it's value is the floor number at 180,%furIndex.y, added 5 to it during the "execution" of the DS, and now is placing the new floor number at 180,furIndex.y (0:10) When a furre leaves the dream, (0:30) When a furre says anything, (0:36) When a furre says or emotes anything, (0:1) Whenever somebody moves, (0:16) When a furre uses any object, (0:71) When a furre stays in the same square for #1 seconds, (5:40) set the floor to type #%data1 at (180,%furIndex.y). (5:41) place object type #%data2 at (180,%furIndex.y). =========== clear data ========== *clearing "local" variables to 0 prevents "swapping" or "mirroring" of data between IDs (0:1) Whenever somebody moves, (0:9) When a furre arrives in the dream, (0:10) When a furre leaves the dream, (0:16) When a furre uses any object, (0:30) When a furre says anything, (5:300) set variable #%furIndex to the value #0. (5:300) set variable #%furPos to the value #0. (5:300) set variable #%furToPos to the value #0. (5:300) set variable #%data1 to the value #0. (5:300) set variable #%data2 to the value #0. *Endtriggers* 8888 *Endtriggers* |