Some Help?

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Some Help?

Post by metal_head » Sat Sep 06, 2008 5:32 pm

Now I'm bringing the question from the Music section to the Scripting section,because scripting will be needed.http://www.realityfactory.info/forum/vi ... =14&t=3814
Now what I want is to create a script,which checks if a trigger is activated and if it is,play a sound so that will look like the player talks.
Now,everyone knows I suck at scripting yet and I'll need some help,I started the script myself,but I have no idea if it's correct and don't know how to do some things.
This is what I did,please don't laugh at me,I'm trying to learn Simkin by myself now and this is what I did:

Code: Select all

TALK1       [sound1.wav]
TALK2       [sound2.wav]
TALK3       [sound3.wav]

	Spawn[ ()
        {
        Console(true);
        PawnRender(false);
        LowLevel("Start");
        }
        Start[ ()
        {
    //If trigger (name) is activated:
        PlaySound(TALK1);
    //If trigger (name) is activated:
        PlaySound(TALK2);
    //If trigger (name) is activated:
        PlaySound(TALK3);
I assume that Low level will be needed for this,right?
I will attatch the Pawn to the player so that the player will hear the sounds played and it will look like the player is talking.But first I'll need help for this,I know it's something simple,and shouldn't be asking such question,but I don't have Idea how to make the script check if a trigger is activated.

User avatar
creekmonkey
Posts: 116
Joined: Tue Oct 23, 2007 2:55 pm

Re: Some Help?

Post by creekmonkey » Sat Sep 06, 2008 8:16 pm

Use GetEventState(char *Trigger ); to check if a trigger is activated, can be called in either Low or HighLevel order. PlaySound(char *Sound ); is a LowLevel command.


if(GetEventState("trigger_name"))
{
PlaySound(sound_name);
}

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Some Help?

Post by metal_head » Sat Sep 06, 2008 8:49 pm

Gee,thanks that's the command I was looking for ! "if(GetEventState("trigger_name"))"

Post Reply