Add Vehicle Sleeper Cab function to a mod

Your forum for all discussions around Modding.
olahaldor
Posts: 252
Joined: Wed Oct 03, 2012 11:08 am
Location: Norway

Add Vehicle Sleeper Cab function to a mod

Post by olahaldor »

Hey! :) I was just made aware of the Vehicle Sleeper Cab mod, and it would be such a great feature to add to a mod, to investigate if I could make use of it. However, my coding/scripting/fiddling with these things isn't my strong suit. If I can make this happen, this will take the possibilities with my Rennebu map to new heights ;)

I see in the sample file it says

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<vehicle type="tractor">
    <enterable>
        <!-- cameraNode: This is the index or i3dMapping of the camera that is used when sleeping. -->
        <!-- deactivateLightsOnSleep: When 'true' all vehicle lights will be turned off when sleeping starts. -->
        <!-- deactivateEngineOnSleep: When 'true' vehicle engine will be turned off when sleeping starts. -->

        <sleeperCab isSleeper="true" cameraNode="0>0|1" deactivateLightsOnSleep="true" deactivateEngineOnSleep="true"/>
    </enterable>
</vehicle>

So I have copied the <enterable> tag and put within the <vehicle> tag of my mod, and a sleeping camera.

I also added "Enterable" as the specialization in the moddesc xml file, as I though that is what these instructions said, in the vehicleSleeperCab.xml file.

Code: Select all

<!-- Do not make changes to this XML file! Mods using the specialization 'Enterable' can add support directly in their own XML. See sdk folder for example mod xml. -->
I'm unable to sleep, basically, because I never see the "press B to..". Where am I stepping wrong, and how can I fix this?