Elven
Posting Freak
Posts: 862
Threads: 37
Joined: Aug 2011
Reputation:
26
|
RE: Resetting the Phonograph
Remember my tutorial? Without condition you cannot make it reset ^^.
|
|
09-08-2011, 11:56 AM |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
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:
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 |
|
MegaScience
Member
Posts: 213
Threads: 1
Joined: Aug 2011
Reputation:
2
|
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 |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
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 |
|
MegaScience
Member
Posts: 213
Threads: 1
Joined: Aug 2011
Reputation:
2
|
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 |
|
Elven
Posting Freak
Posts: 862
Threads: 37
Joined: Aug 2011
Reputation:
26
|
RE: Resetting the Phonograph
U should have said that u wanted to replay after death . It's then just way more easy ;P
|
|
09-09-2011, 11:01 PM |
|
MegaScience
Member
Posts: 213
Threads: 1
Joined: Aug 2011
Reputation:
2
|
RE: Resetting the Phonograph
He got it working.
|
|
09-12-2011, 11:45 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
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 |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
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 |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
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 |
|
|