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
Resetting the Phonograph
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#11
RE: Resetting the Phonograph

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

The Interrogation
Chapter 1

My tutorials
09-08-2011, 11:56 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#12
RE: Resetting the Phonograph

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:

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);
}
(This post was last modified: 09-08-2011, 02:44 PM by Apjjm.)
09-08-2011, 02:42 PM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#13
RE: Resetting the Phonograph

Actually, setting that WheelAngle command made it turnable again, but it wouldn't go off... I'd rather not give it excess spin.
09-09-2011, 04:11 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#14
RE: Resetting the Phonograph

(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.
(This post was last modified: 09-09-2011, 01:37 PM by Apjjm.)
09-09-2011, 01:32 PM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#15
RE: Resetting the Phonograph

    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.
09-09-2011, 03:27 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#16
RE: Resetting the Phonograph

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

The Interrogation
Chapter 1

My tutorials
09-09-2011, 11:01 PM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#17
RE: Resetting the Phonograph

He got it working. Smile
09-12-2011, 11:45 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#18
RE: Resetting the Phonograph

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.

09-26-2011, 07:44 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#19
RE: Resetting the Phonograph

(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.
(This post was last modified: 09-26-2011, 09:16 PM by Apjjm.)
09-26-2011, 09:15 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#20
RE: Resetting the Phonograph

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.

09-26-2011, 09:27 PM
Website Find




Users browsing this thread: 1 Guest(s)