Jump to content

Creating a level: Difference between revisions

m
no edit summary
(Update Template w summary)
Tags: Mobile edit Mobile web edit
mNo edit summary
Line 290: Line 290:
'''Common mistake:'''
'''Common mistake:'''


CJBO files '''need relative paths to the resource instead of just file names'''. Taking consoles, for example: a standard export to XML gives you "console_data". But to use the shared resources these must be paths like "'''consoles/console_data.oni'''" as they are stored in '''shared/console/'''. Note how the demoed '''shared''' folder is placed next to the [http://mods.oni2.net/node/299 project ("lab")] folder and the XML master file points to it using "../shared".
A few CJBO files '''need relative paths for resources'''. Inserting only a file name will not work. Let us take consoles for example: A relative path to a console should look like this: "'''consoles/console_data.oni'''". The resources are stored in '''shared/console/''' but since the XML master file points to the starting folder via "../shared", it will be omitted in all actual resource paths. If you want, look a the files at [http://mods.oni2.net/node/299 demo project "lab"]. '''Doors''' and '''furniture''' also require relative paths.
 
'''lab/lab.xml'''
<?xml version="1.0" encoding="utf-8" ?>
<Oni>
    <Level SharedPath="../shared">
    ...
 
'''lab/Console.xml'''
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <Objects>
        <CONS Id="4695">
            <Header>
                <Flags>Gunk</Flags>
                <Position>944.1944 -27 29.37764</Position>
                <Rotation>3.623707E-05 270 0</Rotation>
            </Header>
            <OSD>
                <Class>consoles/console_data.oni</Class>
                ...
|-
|-
| <Environment>
| <Environment>
8,119

edits