InsertEvent

Topics regarding Scripting with Reality Factory
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

InsertEvent

Post by Danimita92 » Thu Oct 09, 2008 5:10 pm

Hello everybody, I'm asking this by request of Zidane, because he didn't know how to formulate this question, seeing as Spanish is his main language.

Thing is he was trying to match his scripted player's "step" sounds match the actual steps. Then he saw the game "Forged in Fire" and checked its scripts. There he saw the commands InsertEvent, SaveActor, etc.

He made a script that added these events, but RF crashed. He commented the whole script and found out that the error's in the InsertEvent command. How come?

Script:

Code: Select all

{
    Spawn[()
    {
        Console(true);
        LowLevel("setup");
    }]
    
    setup[()
    {
        InsertEvent("Walk","S",0.2);
        InsertEvent("Walk","S",0.6);
        
        SaveActor("jol.act");
        HighLevel("Done");
    }]
    
    Done[()
    {
        Remove(true);   
    }]
 
}

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Thu Oct 09, 2008 10:32 pm

Any help?

Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: InsertEvent

Post by Allanon » Thu Oct 09, 2008 11:04 pm

Does the actor have an animation named "Walk"?

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Thu Oct 09, 2008 11:11 pm

Yes

Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: InsertEvent

Post by Danimita92 » Sat Oct 11, 2008 8:11 pm

Bump

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Thu Oct 16, 2008 6:03 pm

Anybody can try use the InsertEvent command?

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: InsertEvent

Post by Juutis » Thu Oct 16, 2008 9:14 pm

Tested it.

It seems RF crashes if the first parameter of InsertEvent() isn't an animation of the actor. Make sure you type it right.
Pain is only psychological.

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Thu Oct 16, 2008 10:38 pm

Thanks Juutis, but "Walk" animation is correct. I don't know what happend :(

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: InsertEvent

Post by Juutis » Wed Oct 22, 2008 2:12 pm

I'm afraid the only way I can make it crash is to have a wrong animation name. Make sure it's exactly the same as the animation name. IE. Walk != walk != WALK. What version are you using, BTW?

Oh, and sorry for being a slow poster. That's just the way I am. :)
Last edited by Juutis on Wed Oct 22, 2008 3:36 pm, edited 1 time in total.
Pain is only psychological.

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Wed Oct 22, 2008 3:24 pm

Yes , the name is correct :(.... "Walk"
The version is 0.75 with NGD

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: InsertEvent

Post by Juutis » Wed Oct 22, 2008 3:35 pm

Zidane wrote:Yes , the name is correct :(.... "Walk"
The version is 0.75 with NGD
Alright, could be the version. I tested it in 076.
Pain is only psychological.

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Wed Oct 22, 2008 3:57 pm

Aha, I will test in 0.76

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Wed Oct 22, 2008 5:02 pm

Ops, with RF 0.76 crash too. In the picture you can see the log, the model, the script and the anim "Walk".

ImageImage

Any idea?

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: InsertEvent

Post by Juutis » Wed Oct 22, 2008 5:21 pm

Oh wow, I hate to say this but I'm all out of ideas here.

But your goal is to match the step sounds with the actual animation, right? Couldn't you just use a timer or something? I mean every time the player starts the 'Walk' animation wait for 0.2 seconds, play the sound, wait for 0.4 seconds, play the sound again and repeat.
Pain is only psychological.

User avatar
Zidane
Posts: 153
Joined: Mon Feb 11, 2008 1:21 am
Location: Spain

Re: InsertEvent

Post by Zidane » Wed Oct 22, 2008 5:31 pm

Yes my goal is match the step sounds , attack sounds , etc.
I tried timer and self.time before, is a good option, but it have a problem:
If the player is face to a heavy zone of the map ,the steps sounds play fast,otherwise play slow.... depending of the framerate.

Then i thinked in the InsertEvent command, but i dont understand wath happend with it

Post Reply