The script works fine, There just has to be an easier way to do this I just don't know how.
My scripting knowledge is mediocre at best while I know most of the words offhand I can't exactly implement them.
void OnStart(){}
void OnLeave(){}
void OnEnter(){
SetEntityPlayerInteractCallback("book", "pages", true);
AddUseItemCallback("", "key", "door", "unlock", true);
SetSwingDoorLocked("door", true, false);
PlayMusic("TemptingSecrets.ogg", true, .7f, .5f, 2, true);
SetEntityActive("book_open_1", false);
}
void unlock(string &in asItem, string &in asEntity){
SetSwingDoorLocked("door", false, true);
PlayGuiSound("unlock_door.snt", 1.0f);
PreloadParticleSystem("Paper_Blow_Fall.ps");
}
void pages(string &in asEntity){
CreateParticleSystemAtEntity("particle", "Paper_Blow_Fall.ps", "particle_spawner", false);
AddPlayerBodyForce(-20000, 0, 0, false);
AddTimer("timer_1", 1.0f, "act_ent1");
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 act_ent1(string &in asTimer){
SetEntityActive("note_1", true);
StartPlayerLookAt("note_1", 10, 10, "");
AddTimer("timer_2", 1.0f, "act_ent2");
}
void act_ent2(string &in asTimer){
SetEntityActive("note_2", true);
StartPlayerLookAt("note_3", 5, 5, "");
AddTimer("timer_3", 1.0f, "act_ent3");
AddQuest("pickup", "pickup");
}
void act_ent3(string &in asTimer){
SetEntityActive("note_3", true);
AddTimer("timer_4", 1.0f, "act_ent4");
}
void act_ent4(string &in asTimer){
SetEntityActive("note_4", true);
StartPlayerLookAt("note_5", 5, 5, "");
AddTimer("timer_5", 1.0f, "act_ent5");
}
void act_ent5(string &in asTimer){
SetEntityActive("note_5", true);
StartPlayerLookAt("note_6", 9, 9, "");
AddTimer("timer_6", 1.0f, "act_ent6");
}
void act_ent6(string &in asTimer){
SetEntityActive("note_6", true);
AddTimer("timer_7", 1.0f, "act_ent7");
}
void act_ent7(string &in asTimer){
SetEntityActive("note_7", true);
StartPlayerLookAt("note_8", 7, 7, "");
AddTimer("timer_8", 1.0f, "act_ent8");
}
void act_ent8(string &in asTimer){
SetEntityActive("note_8", true);
StartPlayerLookAt("note_1", 15, 15, "");
StopPlayerLookAt();
}
So what happens is the player clicks on a book and all the pages fall out, One page after the other so the player gets some manner of idea as which to pic up first.