Method not found??

Topics regarding Scripting with Reality Factory
Post Reply
Augusti
Posts: 5
Joined: Fri Apr 25, 2008 7:22 pm

Method not found??

Post 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.
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: Method not found??

Post 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.
Augusti
Posts: 5
Joined: Fri Apr 25, 2008 7:22 pm

Re: Method not found??

Post 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?
Post Reply