Mark., on 03 August 2015 - 02:25 PM, said:
If I understand correctly, the sound won't play because the door never closes all the way. The door goes down 99 percent of the way, encounters your actor and moves back up.
Good point I hadn't considered. But in this case the door is totally closing and opening.
This does appear to be a bug - "ifceilingdistl" seems to be the ceiling distance when map is initialised, not what it is currently. See attached test map and associated con file; the actor placed in an initially closed door behaves differently from the actor placed in an initially open door. I think it is a bug as the related "iffloordistl" DOES update in realtime - see test map, pal 23.
Trooper Dan, on 03 August 2015 - 11:00 PM, said:
Keep in mind that using the command soundonce does not mean that the sound plays only once.
Indeed. I just hacked my actual code back to a minimal version to illustrate the issue. I've attached a fuller version.
Trooper Dan, on 03 August 2015 - 11:00 PM, said:
Before you go any farther, you should try using some debugging code. Problems like this will waste a lot of time if you don't know what is going on .... (useful code snipped) ....
Cheers Trooper Dan
I was trying to work out how to debug the code, this is exactly what I'm looking for, thanks !
Empirically, it seems that the mythical "x/y BUILD unit" referenced in the wiki is actually 4 times number of PGUP's, e.g. a door that opens by 16 PGUP's is equivalent to a ceiling distance of 64. Is this always true?
[Edit]
OK, I cant seem to access the actual value used by ifceilingdistl, however using Trroper Dan's method I've a woorkaround where I can manually calculate a sector height:
gamevar debuggy 0 0
gamevar debuggy2 0 0
gamevar sectorid 0 0
(... start of actor code and then ...)
ifhitspace
{
getactor[THISACTOR].sectnum sectorid
getsector[sectorid].ceilingz debuggy
getsector[sectorid].floorz debuggy2
subvarvar debuggy debuggy2 // ceiling minus floor
addlogvar debuggy
}
This gives a value of -1024 * PGUP's which makes more sense (though I'd forgot that UP is -ve Z, D'Oh!)
TTFN,
Jon