Code: Select all
class MusicHandler : StaticEventHandler
{
override void WorldLoaded(WorldEvent e)
{
S_ChangeMusic("",0,true,true);
}
}Code: Select all
class MusicHandler : StaticEventHandler
{
override void WorldLoaded(WorldEvent e)
{
S_ChangeMusic("",0,true,true);
}
}Code: Select all
See:
JAXX A 1 {
A_Warp(AAPTR_MASTER,0,0,37,0,WARPF_INTERPOLATE|WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION);
A_Facetarget(20,20,0,0,FAF_TOP,-10);
if(self.angle<master.angle-90||self.angle>master.angle+90)
{
return ResolveState("DontSee");
}
return ResolveState(null);
}
JAXX A 0 A_JumpIfTargetInLOS("See",90);
DontSee:
JAXX A 1 {
A_Warp(AAPTR_MASTER,0,0,37,0,WARPF_INTERPOLATE|WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION);
if(self.angle<master.angle-1||self.angle>master.angle+1)
{
A_SetAngle(master.angle);
}
}
JAXX A 0 A_JumpIfTargetInLOS("See",90);
Loop;Code: Select all
if(self.angle<master.angle-80)
{
A_SetAngle(master.angle-80);
}
if(self.angle>master.angle+80)
{
A_SetAngle(master.angle+80);
}I just tried a fluidsynth setup, and it takes about a second to begin playing music. That may explain why you don't hear any music playing before it gets changed/muted.Major Cooke wrote:Hmmm. You use regular FMOD or something else? I use fluidsynth so I don't get this sort of issue.
The reason why the comparison in your second code piece isn't working is because you're comparing the raw angle instead of the relative. To do that, try something like this.Jaxxoon R wrote:Is there a right way to clip an actor's angle to within a certain range, based off the angle of its master? I've been toying with head tracking using multipart 3D monsters, and so far I've gotten a quick and dirty version that can return the creature's head to a neutral position if it tries to follow the player out of its range or if it loses the player from its line-of-sight. Only problem is that it tends to jitter at certain angles for whatever reason.
Code: Select all
double delta = -deltaangle(Normalized180(angle), Normalized180(master.angle))
double anglimit = 80; //could just define this as a constant in the actor global scope.
if (abs(delta) > anglimit)
{
if (delta > 0) angle = master.angle - anglimit;
else angle = master.angle + anglimit;
}
Ed the Bat wrote:I'd like to change the music that a level will play. Like, if I have this:...this should mute the music for the level. It does, but I still hear the first note or two of the music before it gets muted. Sounds crappy. Is there a better way to do this?Code: Select all
class MusicHandler : StaticEventHandler { override void WorldLoaded(WorldEvent e) { S_ChangeMusic("",0,true,true); } }


Code: Select all
atan2(tracer.z+(tracer.height*0.5)-self.z,1.0)