Designer Tutorial - Furniture
How to create furniture for moove online Roomancer
The easiest way to create a new item is to modify an existing one.
Please note: Don't modify moove resources directly.
Instead make a copy and add your designer abbreviation / tag / label to the name.
Submit the label at shop search to check, if it is already in use by another designer.
The following examples are always using "My". Please replace it with your own label.
When you create your own shop, you will get package and distribution hints.
Please pay attention to Copyright, e.g. you may not use resources from other designers unless it is explicitly allowed.
Tools and documentation can be found in our Shop under Developer,
in the Community menu section Designer
and in moove Roomancer "Extras", "Developer Tools".
Furniture is different in Roomancer compared to Decorations.
Furniture can be a combination of several components and may have functionality.
moove offers endless possibilities to combine 3D shapes, usage and content.
Examples:
Opening of a web page by using a 3D object
- Please visit our free shop
- Click „Furniture“, then a blue counter. This will download and install this furniture package for Roomancer.
Now you can add counters to your rooms.
- To add a counter at a specific room position, please right click the room floor at this point and select the counter at „Decorate“, „Furniture“. On creating of the counter a dialog will ask for the web page address.
- Just enter for example:
http://somafm.com/play/lush
- As soon as someone is right clicking the counter to "Use" it, the streaming web page opens and plays automatically.
- All kind of actions are possible. You can enter any web page, e.g. shop
or a visiting link for a house or a specific room in a house,
like shown in the Room Tutorial:
http://community.moove.com/cs/as.dll?.SingleTreff
visits the member SingleTreff
http://community.moove.com/cs/as.dll?.SingleTreff:Salon
directly visits the „Salon“ room of this member.
By creating your own furniture you can associate a special web page, e.g. the dialog on creating the furniture can be omitted.
Instead of the „Counter“ you can of course use any kind of 3D shape.
To accomplish this, just import standard 3D models, created with standard 3D modeler software.
The moove tool Imp3DS creates moove SRF files from :3ds Max
model files: *.3DS -> *.SRF
Please have a look at 3D Resources for more information on 3D models and :Texture mapping
.
You can give away furniture as part of a full decorated room, too. Complete rooms can be offered on web pages - the same way as the counter.
Example:
http://www.brandworlds.de/treffpunkt.mpz
This is a web page offering the room:
Housepage.
Furnitue can start any action on the own PC or remote on visited houses and visitors.
The dialogs to decorate the house are implemented in DOORS for example.
All programs can be started on furniture usage, too.
Furniture is created by a script, written in the moove programming language DOORS (Dynamic Object Oriented Runtime System).
These scripts are delivered as source code with every Roomancer. They are in the \moove\Doors folder and have the extension .uni (Universe, universal language).
In this folder you will find the file System_Furniture.uni, which contains moove furniture scripts. System.uni contains supplementing functions.
Please copy System_Furniture.uni to moove\MyDoors\furn.txt.
Please open the file by right click and choose :WordPad
for instance as editor.
When planning a new item, we always check, which existing items comes closest to our imagination.
- Your own "Table, elegant"
- When searching for this expression in furn.txt you will find "TableE:100:50:100".
"TableE" is the internal name. This name makes the association to the preview picture moove\ART\JPG\__FDlg_tableE.jpg. Please make a copy to moove\ART\JPG\__FDlg_MytableE.jpg.
The numbers are giving the furniture dialog "Normal" size in cm - for the X, Y and Z dimensions width, height and depth.
- Please continue searching for "TableE" and you will find FUNCTION FurnTableE. This is the creating function for this item.
- Please create a text file moove\Doors\MyTableE.uni.
- Please copy the source text inclusive separation lines and insert it into the new file. At the beginning of this file you can add comments.
- For renaming our own table we change the function name to FurnMyTableE
- The table consists of two structures (
:surface
, srf). For every one there is a line starting with __FurnSurf.
- The main structure is called "j_table"[.srf] and gets a picture (texture) associated by __FurnTex: "__j_table"[.jpg]
- We like to change this texture and rename the reference to "__j_tableMy"[.jpg]. We don't change the underlines at the beginning.
- We go to the folder moove\ART\JPG and copy the file "__j_table.jpg" to "__j_tableMy.jpg".
- With the help of Graphics editor software we can edit this new file. For instance use Microsoft Photo Editor (part of the Office package) to add a relief.
- The second structure is called "j_table2"[.srf] is colored by __FurnCol - it is the bottom of the table plate.
- The color is black (Color{} or Color{0,0,0}) respectively. We change it to light red (Color{255,0,0}).
The three values stand for the color channels red, green and blue. The maximum value is 255 each. For example yellow consists of red and green: Color{255,255,0}
Please note: The color values are delimited by curly (not round) braces.
You can interactively test the values when creating 3D text in Roomancer. Just have a look at the "Color" values. Or get a Color Picker Software.
- We don't change the structure files for now. But we do not want to depend on their existence at other members. On the other hand we don't want to overwrite other files with the same name.
If we make a copy of a file, we add our label at the end. This way the file will be behind the original on sorting.
Therefore we copy "j_table.srf" to "j_tableMy.srf" and "j_table2.srf" to "j_table2My.srf".
The changed lines for our table are now:
FUNCTION FurnMyTableE(nR,v,nS)
...
__FurnSurf(__FurnTex("__j_tableMy"), "j_tableMy", nS, nSY, nS)
__FurnSurf(__FurnCol(Color{255,0,0}),"j_table2My", nS, nSY, nS)
...
- Please don't forget to save :-)
- After that you can pack your own table into a MPZ file.
Please note the special hints for FURNITURE:
- Pack ID: Enter MyTableE.
:Drag-and-drop
the files moove\MyDoors\MyTableE.uni, moove\ART\JPG\__FDlg_MytableE.jpg, moove\ART\JPG\__j_tableMy.jpg, moove\ART\SRF\j_tableMy.srf and moove\ART\SRF\j_table2My.srf to the "Resources:" field.
- Click on "Furniture...".
- Then "New"
- Internal Name: MyTableE
- X Size: 100
- Y Size: 50
- Z Size: 100
- English Name: My Table, elegant
- German Name: My Tisch, elegant
- Then"OK".
- Then OK at "Furniture List".
- Please click the "File" menu at moovePack (moovePack.exe in your moove folder).
- First save the list with "Save" and then moove\MyTableE.MPL.
- After that use "Create Pack" and moove\MyTableE to create the MPZ file.
- Just double click on moove\MyTableE.mpz to install your table.
- You can now create the table in Roomancer by using the Furniture dialog with "My Table, elegant".
- Now you can apply changes:
- There is no need to use moovePack again to control your changes on surface and texture files.
You only need to change the Roomancer room, to create another table after editing moove\ART\JPG\__j_tableMy.jpg again.
Hint: Use Cleanup Room to remove furniture created for testing.
- You can change the preview picture moove\ART\JPG\__FDlg_MytableE.jpg directly, too. You can print your label / name into the picture.
- At last - or after changing moove\MyDoors\MyTableE.uni - you have to start moovePack again. Use "File", "Open" moove\MyTableE.MPL, then "Create Pack".
- IF you now install with moove\MyTableE.mpz again, changes in Roomancer will not apply, because Roomancer has a overwrite protection.
- You can disable this feature by using the Roomancer menu "View", "Options...", "General", "Advanced" at "Prevent resource overwrite on import".
- Please check it again before importing resources from other members.
- The overwrite protection will prevent updates of your creations at other members.
Therefore it is very important to check everything very carefully before giving it away.
- Please use the FurnitureCheck Tool to check all installed interior items.
You can find this tool in the moove Shop, section Misc.
Please test it with both software and hardware renderer. You can switch in the moove Roomancer browser menu "Extras", "Options", "Rendering".
- At very last you can create another moove\_MyTableE.mpz (starting with underline) without preview picture.
To do that, please unfold Resources: JPG Textures in moovePack and right click on moove\ART\JPG\__FDlg_MytableE.jpg. Then "Remove resource".
Please create only the MPZ file and don't save the list this time.
Members only installing the moove\_MyTableE.mpz without preview cannot create the table for their rooms. But they can see it when visiting.
Please have a look at Roomancer Options.
- A long "Table, elegant"
- The example before did not change the dimensions of the table. The user can only scale all dimensions by the same factor when adding furniture.
- To learn more about dimensions we will purposeful change the table.
- Just now we had the entry "TableE:100:50:100": The dimensions of the table are stored together with the name. This entry is in the
:Registry
of the PC.
If there is this entry and a preview picture, you can use the dialog to add the item to your room. The same entry is transferred to visitors.
By using this name the item will be searched on the visitors PC. If it isn't found, there will be a request at the moove furniture server. BTW: Currently there are only moove furniture stored at this server.
If the item can't be found even there, the dimension information can be used to create a placeholder of this size.
By clicking Roomancer Options on the main community page every user can change related settings.
- The moove system functions in System_Furniture.uni are creating the register entries of its moove furniture.
All other registry entries are automatically created when MPZ files are unpacked and installed by moodl.exe.
The values are given at the moovePack dialog "Internal Name:" to "Z Size:".
- All these mentioned dimension entries are only used, when a placeholder is required.
The furniture item itself normally has the same size, but is only dependent on the individual creating DOORS function.
FUNCTION FurnTableE(nR,v,nS) gets - like all furniture creating functions - following values on call:
- "nR" is the numerical value for the vertical rotation.
- "v" is the vector giving the room position for X, Y and Z.
- "nS" is the numerical factor for scaling - 1.0 means "normal" size
VAddY(v,nS*25) adds 25 cm to the Y component (height) of the position vector "v" (corrected by the scaling value of "nS").
Reason: When inserted into the room the ORIGIN of the item is placed at position "v". "v" is on the floor in most cases.
For "TableE" the ORIGIN is defined as the middle of the item - like with most moove furniture.
We like to have the bottom of the item at the floor level - otherwise the item would sink into the floor.
To accomplish this we have to correct the room position by half of the items height - e.g. by 25 cm.
LOCAL nSY:= 0.5*nS Surfaces are normalized to a cube with 100 cm edge size. Therefore the table height is scaled by 0.5 to get 50 cm.
If we like to create a long table with a width of 70 cm and a depth of 200 cm from our quadratic table (100 cm), we have to change or add following lines:
FUNCTION FurnMyTableEL(nR,v,nS) // my elegant long table
...
LOCAL nSX:= 0.7*nS
LOCAL nSY:= 0.5*nS
LOCAL nSZ:= 2.0*nS
...
__FurnSurf(__FurnTex("__j_tableMy"), "j_tableMy", nSX, nSY, nSZ)
__FurnSurf(__FurnCol(Color{255,0,0}),"j_table2My", nSX, nSY, nSZ)
...
- Functionality makes the real difference for furniture and gadgets. Following types are defined:
##FURN_LIE | usage will let the actor lie on it
|
##FURN_SIT | usage will let the actor sit on it
|
##FURN_SHELF | usage will collect file items of the room as cubes into the shelf
|
##FURN_TABLE | a table
|
##FURN_DOOR | a door
|
##FURN_FUNC | usage will call a special function
|
- FUNCTION __FurnCreateName(vecPos, nYRot, nType, sN, bRemote, sSides, nWidth, nDepth, bServant, xFuncParam) defines the behavior. These are the values on call:
- "vecPos"
:Vector
giving the middle of the sitting area, used with ##FURN_LIE and ##FURN_SIT
Example in FUNCTION FurnChair3:
VAddY(v,nS*50) Add a 50 cm Y-axis displacement to origin vector "v", e.g. the sitting area is 50 cm above ground. The value is scaled by the size factor of the chair
LOCAL sN := __FurnCreateName(v, nR, ##FURN_SIT,NIL ,FALSE ,"1",60*nS,60*nS,FALSE) the sit information is encoded into the name
- "nYRot"
:degree (angle)
between 0 and 360, used with ##FURN_LIE, ##FURN_SIT and ##FURN_SHELF, rotates the functional area
Example in FUNCTION _FurnClubSofa:
LOCAL sN := __FurnCreateName(v, nR+90, ##FURN_SIT,NIL ,FALSE ,"2",140*nS,120*nS,FALSE) to align the rotation to other furniture, 90 degress are added to the user selection
- "nType" the functionality type as mentioned above
- "sN" This parameter is dependent on the functional type
- optional for ##FURN_LIE and ##FURN_SIT: Method of SoulActor{}
Example in FUNCTION FurnMutate:
LOCAL sN := __FurnCreateName(v, nR, ##FURN_SIT, "ActorMutate",FALSE ,"1",80*nS,60*nS,TRUE) the ActorMutate method will change the actor on the Freak-o-Matic
- requested for ##FURN_FUNC: Function to be executed
Example in FUNCTION FurnCactus:
LOCAL sN := __FurnCreateName(NIL, NIL, ##FURN_FUNC, "Cactus",FALSE ,NIL,NIL,NIL,FALSE ,nS) the function FU_Cactus will be called. FU_ is added by the system to indicate Furniture Usage.
- requested for ##FURN_DOOR: room
:GUID
(26) and name of the room to visit. This parameter is internally created by DoorCreateName()
- "bRemote"
:Boolean datatype
. TRUE means: source is only at visited house (not executed out of house)
Example in FUNCTION FurnNotepad:
LOCAL sN := __FurnCreateName(NIL, NIL, ##FURN_FUNC, "Notepad",TRUE ,NIL,NIL,NIL,FALSE) the function RFU_Notepad will be called. This way your visitors are not only accessing their local notepad copy but trigger action in your house. RFU_ is added by the system to indicate Remote Furniture Usage.
- "sSides" used for ##FURN_LIE and ##FURN_SIT: string of digits 0 to 3: entry sides of sitting area
Example in FUNCTION FurnBed:
LOCAL sN := __FurnCreateName(v, nR, ##FURN_LIE,NIL ,FALSE ,"012",260*nS,180*nS,FALSE) the actor can approach the bed from the sides 0, 1 and 2, but not from 3, the head plate
- "nWidth" used for ##FURN_LIE and ##FURN_SIT: Width of sitting area, 260 cm in the example above
- "nDepth" used for ##FURN_LIE and ##FURN_SIT: Depth of sitting area, 180 cm in the example above
- "bServant" boolean parameter used for ##FURN_FUNC. TRUE means: may by used by servants
Example in FUNCTION ServGlass:
LOCAL sN := __FurnCreateName(NIL, NIL, ##FURN_FUNC, "Glass",FALSE ,NIL,NIL,NIL,TRUE) the glass can be used by Servants. Functions to create servant aware furniture start with "Serv" instead of "Furn".
- "xFuncParam" used for ##FURN_FUNC and bRemote: optional parameter for Function "sN"
Example in FUNCTION FurnTorch:
LOCAL sN := __FurnCreateName(NIL, NIL, ##FURN_FUNC, "Torch",FALSE ,NIL,NIL,NIL,FALSE ,nS) the scaling value will be used to adapt the flame size when using the torch: FU_Torch(Furniture, Actor, sParam). "sParam" is the stringified scaling value "nS"
Example in FUNCTION FurnCounter:
LOCAL sN := __FurnCreateURL("Counter", "http://www.mycompany.com/order.asp?name=%?") default address associated with the counter (%? will be replace by the nickname, when a visitor uses the counter)
sN := __FurnCreateName(NIL, NIL, ##FURN_FUNC, "URL",FALSE,NIL,NIL,NIL,FALSE,sN) the address "sN" will be used as default, when the owner uses the counter to setup the address for the visitors: FU_URL(Furniture, Actor, sParam). "sParam" contains "sN".
- FUNCTION FurnBegin(sName, nLightIdx, vecPos, nXRot, nYRot, nZRot, bNoClimb, nGroupType, bNoDrag, bNoShadow, bNoStack, bHardwareOptimized, nShader) starts creating the furniture. These are the values on call:
- "sName" the name created by __FurnCreateName()
- "nLightIdx" numeric light source id for shadows or -1 for unshaded (default)
- "vecPos" origin
:Vector
of the furniture. Usually half of the height is added to the floor position chosen by the user.
Example in FUNCTION FurnTeaPot:
VAddY(v,nS*15) adds 15 cm to the Y component (height) of the position vector "v" (corrected by the scaling value of "nS").
FurnBegin(sN, -1, v, 0,nR,0 ,NIL ,NIL, TRUE)
- "nXRot,nYRot,nZRot": degree values between 0 and 360 for rotation about axes X, Y, Z. Usually "0,nR,0", e.g. vertical Y rotation like chosen by the user.
Example in FUNCTION FurnCHead:
FurnBegin(sN, -1, v,0 , nR + 90,0 ,NIL ,NIL, TRUE) additional 90 degree Y rotation
- "bNoClimb" is an optional
:Boolean datatype
. TRUE means the user has no climb option in the furniture menu.
Example in FUNCTION FurnLamp:
FurnBegin(sN, -1, v, 0,nR,0 ,TRUE,NIL, TRUE) don't climb the lamp
- "nGroupType" reserved for internal functionality, for example stairs
- "bNoDrag" is an optional boolean parameter. TRUE means the user cannot drag items onto the furniture
Example in FUNCTION FurnCarpet:
FurnBegin(sN, -1/*nLightIdx*/, v, 0,nR,0 ,NIL/*bNoClimb*/ ,NIL/*nGroupType*/, TRUE/*bNoDrag*/, TRUE/*bNoShadow*/, TRUE/*bNoStack*/, bHardwareOptimized, nShader)
- "bNoShadow" is an optional boolean parameter. TRUE means no shadow by that furniture, TRUE in the example above
- "bNoStack" is an optional boolean parameter. TRUE means furniture is not stackable, TRUE in the example above
- "bHardwareOptimized" is an optional boolean parameter. TRUE means the furniture is optimized for the 3D hardware renderer (moove Roomancer browser menu "Extras", "Options", "Rendering")
- "nShader" numeric id of the
:Shader
, please see interactive creation of these parameters in the Decomaker.
Hint: Since all properties of furniture are packed into the internal name of it, it is very useful to check, how your changes affect the internal name and to compare it with other furniture and decorations.
If you click the Roomancer Menu "View", "Options...", "Service" and activate the "Test Mode" (please uncheck it again afterwards), you will get the internal name by double clicking of the furniture.
- FUNCTION __FurnSurf(nMatIdx, sSurfName, nScaleX, nScaleY, nScaleZ, bTransp, nVertIdx, vecDisplace) adds a surface. These are the values on call:
- "nMatIdx" is a numeric material ID. Materials are colors created by __FurnCol() or textures created by __FurnTex()
- "sSurfName" is the name of the srf file
- "nScaleX, nScaleY, nScaleZ" are scaling factors for X, Y and Z dimension. 1 means no scaling. Normally the scaling is combined with the user selection for furniture size
- "bTransp" is an optional boolean parameter. TRUE means the surface has
:transparency
.
- "nVertIdx" is an optional numeric number for a
:vertex
giving a displacement of this surface related to the furniture origin.
- "vecDisplace" is an optional vector giving a displacement of this surface related to the furniture origin.
Example in FUNCTION FurnBench:
v := Vector{-70*nS,0,0} Create a X-axis displacement vector "v". The value is scaled by the size factor of the bench
__FurnSurf(nMat0, "benchll_0", nSX, nSY, nsZ, NIL, NIL, v) Surface with displacement "v"
- FUNCTION __FurnTex(s, bFShorten) creates a texture handle to be used for __FurnSurf(). These are the values on call:
- "s" is the name of the texture file - normally with
:JPG
extension. By convention these files are starting with two underlines. If there is a third underline, it is a :BMP
file with :Cyan
as transparency color.
Example in FUNCTION FurnTree:
__FurnSurf(__FurnTex("___Crown"), "Tree1_1", 1.5*nS, 2*nS, 1.5*nS,TRUE) The crown of the tree has transparency between the leaves. Texture file is \Art\Bmp\___Crown.bmp
- "bFShorten" is an optional boolean parameter. If it is TRUE,
:foreshortening
distortions in :Texture mapping
are prevented for this texture. Only the software renderer is affected and will be slower.
- "Door to other house"
The standard doors in Roomancer are going to rooms inside of the house.
As an example for the tutorial we are creating a door leading to other members` rooms.
You can use your special structure and texture files.
Our example uses the registry entry "DoorExtern:150:230:30", the German name is "Tür zu anderem Haus".
The helper function GetVisitTarget() asks for the nickname and the room, when the owner adds the door to the room.
FUNCTION FurnDoorExtern(nR,v,nS) // tutorial example
LOCAL sN := GetVisitTarget() // visit URL
IF sN != ''
sN := __FurnCreateName(NIL, NIL, ##FURN_FUNC, "URL",FALSE,NIL,NIL,NIL,FALSE,sN) // go to URL on usage
VAddY(v,nS*115)
FurnBegin(sN, -1, v, 0,nR,0 ,TRUE/*bNoClimb*/ ,NIL/*nGroupType*/, TRUE/*bNoDrag*/, TRUE/*bNoShadow*/, TRUE/*bNoStack*/, NIL/*bHardwareOptimized*/, NIL/*nShader*/)
LOCAL nMat := __FurnCol(Color{115,115,115}) // grey as an example
__FurnSurf(nMat, "door_1", 1.5*nS, 2.3*nS, 0.3*nS) // Door, classic as an example
FurnEnd()
ENDIF
------------------------------------------------------------------------------
FUNCTION GetVisitTarget()
StringSet German
"Bitte Nicknamen des zu besuchenden Hauses eingeben."
"Zusätzlich kann dahinter ein ':' und Raumname eingegeben werden. "
"Beispiel: Edgar:Salon"
END
GLOBAL FurnAdd_sParam
LOCAL sN
IF FurnAdd_sParam != NIL
sN := FurnAdd_sParam
ELSE
LOCAL sRegPath := "Settings"
LOCAL sOld := RegistryGetString(sRegPath, "DefVisitTarget")
sN := GetStringDlg(sOld,\
{#"Please enter nickname of the house to visit.",\
#"Optional you can add an ':' followed by room name.",\
#"Example: Edgar:Salon"})
IF sN != sOld; RegistryPut(sRegPath, sN, "DefVisitTarget"); ENDIF
IF sN != ''
sN := ActiveServerPath() +'ecvisit&ud=' +URLEncode(sN)
ENDIF
ENDIF
RETURN sN
- Add Copyright information:
- Add a comment line to your functions:
/*** Copyright yourDesignerNickname ***/
- Let the decorator know by adding a call to your unique copyright function. Add following line to your furniture function:
MyCopyright()
- You have to write your own MyCopyright function - a single one for all of your furniture functions:
FUNCTION MyCopyright(s)
IF s = NIL
s := 'http://www.yourDesignerHomepage.com'
ENDIF
GLOBAL FurnAdd_sParam
IF FurnAdd_sParam = NIL // dialog?
?"Copyright yourDesignerNickname,", s
ENDIF
- You have the option to give a special (selling) address for this furniture. Example:
MyCopyright('http://www.yourDesignerHomepage.com/yourFurniture')
Congratulations, you are a furniture designer and DOORS programmer now!
Carpets & decorations
Tutorial - Actors
Tutorial - Sprites
Tutorial - Styles
Tutorial - Commands
Tutorial - Rooms
DOORS
DOORS API
3D Designer Help
3D Resources
Color and Background
Shop -> Developer
Links for Designer
My Contest Pictures
Most valuable Designer
Thank you links
New Name
moove.com
0.08 Seconds