Page 1 of 1

Method not found??

Posted: Mon Apr 28, 2008 3:59 pm
by Augusti
I'm trying to make a pawn to play a sound file

Code: Select all

FOUNDTARGETSOUND    [Taunts\\Soldier_FoundTarget.wav]
.
.
.
// found a target to attack
FoundTarget[ ()
{
	PlaySound(FOUNDTARGETSOUND);
	DelTimerOrder(1);	// get rid of alert timer
	LowLevel(RUNFUNC);	// attack functions are low level
} ]
When I enter the FOV of the pawn in the game, Every time the console gives the same error:

Code: Select all

Scripts\GenericSoldier.s:FoundTarget:0-Method PlaySound not found*
As far as I know, the "0" stand or the line number in the order. I think I'm using the function correctly, so where's the problem? I have the latest version of Reality Factory.

Re: Method not found??

Posted: Mon Apr 28, 2008 4:20 pm
by bernie
PlaySound() is a Low level command. You can't mix Low and high Level commands in the same order you need to switch to low level to use that command.

Re: Method not found??

Posted: Mon Apr 28, 2008 4:51 pm
by Augusti
Fair enough. Can I pass the filename as a parameter while switching to lowlevel, i.e. LowLevel("PlaySound(ALERTTOIDLESOUND)")? It doesn't seem to work that way, I did try. Btw, does the processing return back to FoundTarget when the sound has been played. Generally speaking, what is the best way call PlaySound while in high-level?