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
PropAnimation won't stop playing
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#1
PropAnimation won't stop playing

Hi everyone. I've created a spraylock door using the AMFP assets, but I had to sort of brute force my way into making it work well considering not all of the AMFP scripts work with amnesia (notably, the SetSwingDoorOpenAmount one, that makes ATDD crash). What I had to do was use two separate spraylock door entities and call each other into existence as the script goes through its motions. It's nowhere near as elegant as AMFP, but I made it work. ALMOST. I have one problem that's bothering the crap out of me: the SwingDoor entity that actually works has an endlessly looping 'opening' animation hard-wired into it or something. As it's swinging open, even after the first animation of opening the gear locks has played, it endlessly loops until I close it again and replace it with the other entity.

Here's a screenshot of how it looks in the editor, so I can more easily explain:
[Image: 58tk6sG.jpg]

The first door, hidden within the BlockBox and set to inactive, is the door that gets activated AFTER the animation. It is the one that actually swings open. For whatever reason, the AMFP assets have multiple versions of the same door in their assets: one that has no collision, but has the working animations that have their proper names all set up. That's the one that's floating off in space (I had to do that to get it to show up in the proper place in-game, I have no idea why they made the asset with the point of origin so far off from the middle, but it crashes when I try to move it and re-save it). So, that floating door plays the animation and is set to inactive, then the other door (which has collision and a proper hinge) is set to active and opens. This works perfectly, except for one thing: the second door, the one with collision, has the most irritating thing going on with it. It has a looping animation of the 'door opening' going on, and it has no name in the entity file for me to change it via scripting. I've tried using "PlayPropAnimation" with blank fields and with "none" being called, and nothing works. Here's what the animations box looks like in the modeleditor:
[Image: jqhnaBD.jpg]
Notice how the animation isn't a normal named one, it's a directory path to my amnesia folder. Something here is weird!

And for further help illustrating the issue, here's the (ugly, inelegant, but effective) script that I used.
void main_door(string &in asEntity, int alState)
{
if(alState == 1)
    {
    AddTimer("", 2, "main_door_open");
    PlaySoundAtEntity("", "13_press_done.snt", "valve_hiss", 0, false);
    for(int i=5;i<=6;i++)SetWheelInteractionDisablesStuck("valve_single_"+i, false);
    for(int i=5;i<=6;i++)SetWheelStuckState("valve_single_"+i, 1, false);
    }
if(alState == -1)
    {
    AddTimer("", 2, "main_door_close");
    PlaySoundAtEntity("", "13_press_fail.snt", "valve_hiss", 0, false);
    for(int i=5;i<=6;i++)SetWheelInteractionDisablesStuck("valve_single_"+i, false);
    for(int i=5;i<=6;i++)SetWheelStuckState("valve_single_"+i, -1, false);
    }
}
void main_door2(string &in asEntity, int alState)
{
if(alState == 1)
    {
    AddTimer("", 2, "main_door_open2");
    PlaySoundAtEntity("", "13_press_done.snt", "valve_hiss2", 0, false);
    for(int i=5;i<=6;i++)SetWheelInteractionDisablesStuck("valve_single_"+i, false);
    for(int i=5;i<=6;i++)SetWheelStuckState("valve_single_"+i, 1, false);
    }
if(alState == -1)
    {
    AddTimer("", 2, "main_door_close");
    PlaySoundAtEntity("", "13_press_fail.snt", "valve_hiss2", 0, false);
    for(int i=5;i<=6;i++)SetWheelInteractionDisablesStuck("valve_single_"+i, false);
    for(int i=5;i<=6;i++)SetWheelStuckState("valve_single_"+i, -1, false);
    }
}
void main_door_open(string &in asTimer)
{
    PlaySoundAtEntity("", "door_mech_unlock_INSIDE.snt", "door_swing", 0, false);
    PlayPropAnimation("door01_closed_1", "opening", 0, false, "");
    AddTimer("", 2.2, "main_door_openB");
}
void main_door_open2(string &in asTimer)
{
    PlaySoundAtEntity("", "door_mech_unlock_OUTSIDE.snt", "door_swing", 0, false);
    PlayPropAnimation("door01_closed_1", "opening", 0, false, "");
    AddTimer("", 2.2, "main_door_openB");
}
void main_door_openB(string &in asTimer)
{
    PlayPropAnimation("door01_closed_1", "open", 0, false, "");
    SetEntityActive("door01_closed_1", false);
    SetEntityActive("door_1", true);
    PlayPropAnimation("door_1", "none", 0, true, "");
    StopPropMovement("door_1");
    SetEntityActive("block_box_all_6", false);
    PlaySoundAtEntity("", "door_hinge_open.snt", "door_swing", 0, false);
    AddTimer("door_open", 0.1, "door_open");    
    AddTimer("", 3, "main_door_openC");
}
void door_open(string &in asTimer)
{
    AddPropForce("door_1", 150, 0, 0, "world");
    AddTimer("door_open", 0.1, "door_open");
}
void main_door_openC(string &in asTimer)
{
    RemoveTimer("door_open");
    for(int i=5;i<=6;i++)SetWheelInteractionDisablesStuck("valve_single_"+i, true);
}
void main_door_close(string &in asTimer)
{
    PlaySoundAtEntity("", "door_hinge_close_INSIDE.snt", "door_swing", 0, false);
    AddTimer("door_close", 0.1, "door_close");    
    AddTimer("", 3, "main_door_closeB");
}
void door_close(string &in asTimer)
{
    AddPropForce("door_1", -300, 0, -300, "world");
    AddTimer("door_close", 0.1, "door_close");
}
void main_door_closeB(string &in asTimer)
{
    SetEntityActive("door01_closed_1", true);
    SetEntityActive("door_1", false);
    SetEntityActive("block_box_all_6", true);
    RemoveTimer("door_close");
    PlayPropAnimation("door01_closed_1", "closing", 0, false, "");
    PlaySoundAtEntity("", "door_mech_unlock_INSIDE.snt", "door_swing", 0, false);
    AddTimer("", 2.2, "main_door_closeC");
}
void main_door_closeC(string &in asTimer)
{
    PlayPropAnimation("door01_closed_1", "closed", 0, false, "");
    for(int i=5;i<=6;i++)SetWheelInteractionDisablesStuck("valve_single_"+i, true);
}

And last but not least, a video of the whole process. This shows you how after all my awkward attempts at recreating a simple AMFP script, it comes SO CLOSE to working perfectly. I just need to find a way to remove that animation from the second door that gets called into existence. As it is, it always loops the animation, no matter what I do. I can't remove it from the animations in the modeleditor, as it doesn't even show up as one in there. It's just a blank field. I can't tell the door to play 'none' animations, and I don't know why. It just really wants to move, it's like it drank too much damn coffee.

[Image: signature-2.png]
(This post was last modified: 08-02-2015, 04:22 PM by Streetboat.)
08-02-2015, 04:15 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#2
RE: PropAnimation won't stop playing

sadface Sad i was hoping this would be a fairly common problem with peeps using AMFP assets, or at least someone else had tried making a spraylock door in ATDD before.

[Image: signature-2.png]
08-07-2015, 12:26 AM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#3
RE: PropAnimation won't stop playing

Can't you just turn the spraylock door into an object that rotates? Like one of these shelves that rotate upon pulling a lever.
08-07-2015, 01:24 AM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#4
RE: PropAnimation won't stop playing

Yeah I played with it too, it's the first thing I tried to import from AMFP. It's a puzzle how that thing works, with all those files involved, the block box, the code, the animations, the constant crashes, etc.
I think it's very acceptable the version you made, I couldn't get that far. Kudos. It's great.

08-07-2015, 03:25 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#5
RE: PropAnimation won't stop playing

But but but I want it to be perfect Sad

[Image: signature-2.png]
08-07-2015, 03:37 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#6
RE: PropAnimation won't stop playing

(08-07-2015, 03:37 PM)Streetboat Wrote: But but but I want it to be perfect Sad

Just stick with it.
Seems like it's too difficult, If machien for pigs used newer hpl engine, then it's totally impossible, or too difficult to make some things possible.
I have "dreams" about creating perfect things, but hpl can't handle that.
08-07-2015, 08:57 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#7
RE: PropAnimation won't stop playing

PFFT.

You keep it at it Streetboat, aim for perfection.
08-08-2015, 10:44 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: PropAnimation won't stop playing

Maybe you should just edit the model to work better in your environment. Split up things that don't work that well together and have them act individually.

Perhaps Traggey can help you, I heard he's a good Maya user.

08-08-2015, 12:42 PM
Find
Catalyst Offline
Member

Posts: 213
Threads: 32
Joined: Aug 2014
Reputation: 3
#9
RE: PropAnimation won't stop playing

(08-08-2015, 12:42 PM)Mugbill Wrote: Maybe you should just edit the model to work better in your environment. Split up things that don't work that well together and have them act individually.

Perhaps Traggey can help you, I heard he's a good Maya user.

Perphaps, Traggey told me that he isn't a Maya user, 3DS Max. Mudbill, is that you?

Egypt CS
[Image: 27003.png]
08-08-2015, 12:50 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#10
RE: PropAnimation won't stop playing

(08-08-2015, 12:42 PM)Mugbill Wrote: Maybe you should just edit the model to work better in your environment. Split up things that don't work that well together and have them act individually.

Perhaps Traggey can help you, I heard he's a good Maya user.

that was pretty vague, what do you mean, "just" edit the model? Split up what things that dont work well together? Are you referring to the fact that the door is made up of like 8 models in the editor?

[Image: signature-2.png]
08-08-2015, 04:04 PM
Find




Users browsing this thread: 1 Guest(s)