Frictional Games Forum (read-only)
Resetting the Phonograph - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Resetting the Phonograph (/thread-10201.html)

Pages: 1 2 3


RE: Resetting the Phonograph - Elven - 09-08-2011

Remember my tutorial? Without condition you cannot make it reset ^^.



RE: Resetting the Phonograph - Apjjm - 09-08-2011

It does indeed appear that reset prop was not resetting the state of the wheel (only the position of it?). Here is a slight work around which should do the trick (worked for me in a test map).

Phonograph Settings:
Spoiler below!

[Image: gLwvN.png]



Code:

Code:
void OnStart() {
  //For testing, use lantern to reset prop.
  GiveItemFromFile("lantern", "lantern.ent");
  SetLanternLitCallback("cbLlit");
}

void cbLlit(bool abLit) {
  if(abLit)
   {
     AddDebugMessage("Resetting Prop",false);
     //Unstick & reset phonograph
     SetWheelStuckState("phonograph_1",0,false);
     SetWheelAngle("phonograph_1",0,false);
   }
}

void cbPhonographChange(string &in asEntity, int alState) {
  //Make the phonograph stuck at maximum
  if(alState == 1) SetWheelStuckState(asEntity,alState,true);
  AddDebugMessage("State changed: " + asEntity + " ( " + alState + " ) ", false);
}



RE: Resetting the Phonograph - MegaScience - 09-09-2011

Actually, setting that WheelAngle command made it turnable again, but it wouldn't go off... I'd rather not give it excess spin.



RE: Resetting the Phonograph - Apjjm - 09-09-2011

(09-09-2011, 04:11 AM)MegaScience Wrote: Actually, setting that WheelAngle command made it turnable again, but it wouldn't go off... I'd rather not give it excess spin.
I assumed you wanted the player the turn the wheel again to set off any effects? The state callback does fire again fine for me (it will also trigger on the reset to with alstate =-1 - which is why checking that the state =1 is important) - if this isn't happening for you there must be a script error somewhere.


RE: Resetting the Phonograph - MegaScience - 09-09-2011

Code:
    SetWheelAngle("phonograph_1", 0, false);
    SetEntityInteractionDisabled("phonograph_1", false);
    SetEntityPlayerInteractCallback("phonograph_1", "StateChangePhono", false);

I tried the above, still nothing. I'll upload it now and PM it to you. I just want it to be usable after death, without making it act awkwardly, such as making it have to spin tons more or anything.


RE: Resetting the Phonograph - Elven - 09-09-2011

U should have said that u wanted to replay after death Tongue. It's then just way more easy ;P



RE: Resetting the Phonograph - MegaScience - 09-12-2011

He got it working. Smile


RE: Resetting the Phonograph - Tanshaydar - 09-26-2011

How did you manage to exactly reset the phonograph? I'm trying to get it back to its default state, but it does not act like I want.


RE: Resetting the Phonograph - Apjjm - 09-26-2011

(09-26-2011, 07:44 PM)Tanshaydar Wrote: How did you manage to exactly reset the phonograph? I'm trying to get it back to its default state, but it does not act like I want.
Pretty much as described above. I used the settings as pictured above with that code, but just implemented it into the map - I did use a max limit of 360 though, and did it in a checkpoint callback.
The important part is overriding the default values so that the wheel can be spun both ways iirc - this lets you reset with setwheelangle.


RE: Resetting the Phonograph - Tanshaydar - 09-26-2011

Both ways? That's a little against to what I'm trying to do.
If resetting angle works, I might come with another workaround for my purpose.