Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
There has got to be an easier way to do this...
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: There has got to be an easier way to do this...

Well, the timers can be changed to this.

void pages(string &in asEntity){
    CreateParticleSystemAtEntity("particle", "Paper_Blow_Fall.ps", "particle_spawner", false);
    AddPlayerBodyForce(-20000, 0, 0, false);
    AddTimer("timer_1", 1.0f, "timer");
    AddTimer("timer_10", .5f, "timer");
}

void timer(string &in asTimer)
{
     if(asTimer == "timer_1"){
          SetEntityActive("note_1", true);
          StartPlayerLookAt("note_1", 10, 10, "");
          AddTimer("timer_2", 1.0f, "act_ent2");
     }
     else if(asTimer == "timer_10"){
          SetEntityActive("fakebook", true);
          AddPropForce("fakebook", -150, -30,  0, "world");
          PlayGuiSound("book_paper_fall.ogg", 1.0f);
     }
}

Or this:

void pages(string &in asEntity){
    CreateParticleSystemAtEntity("particle", "Paper_Blow_Fall.ps", "particle_spawner", false);
    AddPlayerBodyForce(-20000, 0, 0, false);
    AddTimer("timer", 1.0f, "timer");
    AddTimer("timer_10", .5f, "sound1");
}

void sound1(string &in asTimer)
{
     SetEntityActive("fakebook", true);
     AddPropForce("fakebook", -150, -30,  0, "world");
     PlayGuiSound("book_paper_fall.ogg", 1.0f);
}

void timer(string &in asTimer)
{
     string sEvent = asTimer;
     float fEventSpeed = 1.0f;
     bool bPauseAtStep = false;
     AddLocalVarInt(asTimer, 1);
    
     switch(GetLocalVarInt(sEvent))
     {
          case 1:
                SetEntityActive("note_1", true);
                StartPlayerLookAt("note_1", 10, 10, "");
                fEventSpeed = 1.0f;  //The time before starting the next case
          break;
          case 2:
                SetEntityActive("note_2", true);
                StartPlayerLookAt("note_3", 5, 5, "");
                AddQuest("pickup", "pickup");
                fEventSpeed = 1.0f;
          break;
          case 3:
                //Just continue your timers here
          break;

          //Called when no more cases are found
          default:
               bPauseAtStep = true;
          break;
     }

     if(!bPauseAtStep)
        AddTimer(sEvent, fEventSpeed, sEvent);
}

Well, there are two here. Hopefully at least one of them well serve useful.
03-01-2014, 10:08 PM
Find


Messages In This Thread
RE: There has got to be an easier way to do this... - by Neelke - 03-01-2014, 10:08 PM



Users browsing this thread: 1 Guest(s)