I can't create a new door schema. - by Lady Rowena
Lady Rowena on 25/5/2013 at 23:50
I wanted to create a new schema for soft sliding doors, i.e. banners.
I made this one, and I put it in DOORS-SCH
//SLIDING DOOR SOFT -PLYR OPENING & CLOSING SOFT
schema doorsoft1
archetype PLYR_DOOR
volume -500
d_soft1
env_tag (Event StateChange) (DoorType SlideSoft) (OpenState Opening Closing) (OldOpenState Opening Closing)
//SLIDING DOOR SOFT -PLYR OPENING & CLOSING SOFT
schema doorsoft2
archetype PLYR_DOOR
volume -500
d_soft2
env_tag (Event StateChange) (DoorType SlideSoft) (OpenState Open Closed) (OldOpenState Opening Closing)
Then I put this in Envsound.spc:
//DOOR TYPES
tag DoorType Wood1Sm Wood2Lg Wood3Vic Wood4Off Shutter Barricade Metal Metal2Hvy Metal3Wh Metal4Mech Cell Bars OblManhole Manhole Slide1 Slide2Sm Slide3Fast Blast Pressure SubHatch GiantPort SlideSoft
Of course my sounds are in SND folder
I reloaded the schemas and my doorsoft1 and doorsoft2 are just there. Then I gave to my banner: Schema\Class Tags: SlideSoft
But it doesn't work, I can't hear any sound. If I try Play Schema from the menu, I have this error in the monolog:
SndCrackWaveHeader returned error
_sfx_start_play: couldnt create d_soft1
What am I doing wrong? Any help please?
R Soul on 26/5/2013 at 00:32
The fact that it mentions the wav file name suggests that the schemas are set up properly, so there could be an issue with the wav files.
Try replacing d_soft1 with alarm1lp, and d_soft2 with alarm3lp.
Those wav files come with the game so you can be sure they work fine.
Lady Rowena on 26/5/2013 at 00:45
Thanks R Soul, I will try it tomorrow. It's too late now. :bored:
Yandros on 26/5/2013 at 04:23
This may only be a typo, but
Schema\Class Tags: SlideSoft
should be
Schema\Class Tags: DoorType SlideSoft
Assuming that is correct, then it is likely to be the WAV file itself. If you're trying to compress to IMA ADPCM format, I would get it working with straight uncompressed PCM WAV for now and worry about that only after the schema is working. If you email me the WAV file I can also work to figure out what the problem is.
Lady Rowena on 26/5/2013 at 11:44
It was the sound! I converted it in a proper format as Yandros said, and now it works....well half of it.
I can hear the "shut" sound (d_soft2), but not the "dragging" sound (d_soft1), so it must be something wrong with the schema itself. I can't figure out what it is, I copied the schema from the originals.
The monolog says nothing, as if everything is working well.
edit
Solved! I had to add this:
//SLIDING DOOR SOFT -PLYR OPENING & CLOSING SOFT
schema doorsoft1
archetype PLYR_DOOR
volume -100
d_soft1
env_tag (Event StateChange) (DoorType SlideSoft) (OpenState Opening Closing) (OldOpenState Open Closed Opening Closing) (CreatureType Player)
Thanks everyone. :)
edit 2
I had to delete (CreatureType Player), because the sound can't be heard if you open the door with a lever. I should have known it, I had problems with shutters making no sound if opened by a lever, I had to change the door type tag.
R Soul on 26/5/2013 at 13:10
I'm not sure about the additions to OldOpenState, but removing CreatureType Player makes sense. With that tag present, the schema will only play if the thing that opened the door is the player. Even though you have frobbed the lever, as far as the game's concerned, the lever is responsible.
Doors have two sets of schemas. In Doors.sch there are two sections: Player doors and AI doors.
There are two copies of //WOOD DOOR 1. In the Player doors section, it has the line archetype PLYR_DOOR and (CreatureType Player).
Anything under the PLYR_DOOR archetype is slightly suspicious. That's why an AI who hears you open a door will make a comment, but not get too bothered.
In the AI doors section is another //WOOD DOOR 1. This time the archetype is AI_DOOR (not suspicious) and there is no (CreatureType Player).
The schema has a different name so it doesn't override the first one.
If you use a lever to open a DoorType Wood1sm, it's the doorwood_op_ai schema that plays. When frobbed by you, it plays doorwood1_op_p.