It doesn't work, maybe impossible?! - 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: It doesn't work, maybe impossible?! (/thread-29910.html) Pages:
1
2
|
It doesn't work, maybe impossible?! - Amnesiaplayer - 05-09-2015 SetEntityConnectionStateChangeCallback("WorkingLever", "MoveShelf"); void MoveShelf(string &in asEntity, int alState) { if (alState == -1) { SetEntityActive("Shelf2", true); SetEntityActive("Shelf1", false); PlaySoundAtEntity("", "quest_completed.snt", "", 0, false); return; } } I used a shelf called "Shelf1" that has to disappear, and Shelf2 has to appear. I know it's a little lame, but the shelf I use is the one without moveblabla. And the shelf is like, too far away from you, so you couldn't notice it "appeared&disappeared" instead of moving. But it doesn't work. the sound doesn't play either. Did I forgot something?! like to mention, I don't have anything written in the "entity" tab... RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-09-2015 Is the lever the correct name? Are you sure you're pulling the lever up? RE: It doesn't work, maybe impossible?! - Daemian - 05-10-2015 Try with another entity, like a grunt or a book, maybe that bookshelf can't be set disabled. And remove the condition(if==) to see if the function it's working. Add some debug messages. RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015 (05-10-2015, 02:38 AM)Daemian Wrote: Try with another entity, like a grunt or a book, maybe that bookshelf can't be set disabled. I don't believe that. He wasn't super specific, but he used 2 shelves (which I guess are the same type of entity). If one starts active, and another one inactive, both would be active if they couldn't be disabled. Then that would've been the problem, and not the script, which I think he would've said if that was the case... But eh, if nothing works, do try it with another entity! I just find it a waste of effort, if it's obvious that is not the case RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015 I'm sure the thing it self didn't work because the Playgui sound didn't played tho... RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015 (05-10-2015, 03:17 PM)Amnesiaplayer Wrote: I'm sure the thing it self didn't work because the Playgui sound didn't played tho... You're not using PlayGuiSound. You're using PlaySoundAtEntity, and you haven't specified a place it should play. That's probably why the sound isn't working. You can always check with a debug message. RE: It doesn't work, maybe impossible?! - Radical Batz - 05-10-2015 Firstly You didn't tell the script where its going to play this sound, You also need to type in the entity the sound will come fro. Otherwise you can use PlayGuiSound PHP Code: PlayGuiSound("quest_completed", 1.6f); Secondly, try using other shelf entities, not movable ones. Maybe the ones from the storage file and make sure they are the correct name. RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015 (05-10-2015, 03:40 PM)Mr. Badcatz Wrote: Firstly I am already using one of those. I'm sure they can get activated and de activated. (because everything can lol) (+w/ everything I mean entities.) I'm trying now, hoping it works Okey thanks everyone! It worked, But My old problem, I really forgot how to "move" and object.. Like I want my custom wall move (yes it is a connectionstate etc, After pulling the other lever, I hear the music, telling me that the script worked, but How do I move the wall>?! Like, I want to move it a little high... This is my script for now void MoveWall(string &in asEntity, int alState) { if (alState == 1) { SetMoveObjectState("EgyptMove",1.0f); PlayGuiSound("quest_completed", 5); return; } } It didn;t work well, Do I have to type in connectionchamngestatecallback tihng in entity tab the name of the func?! like MoveWall, Or do you need more things..? RE: It doesn't work, maybe impossible?! - FlawlessHappiness - 05-10-2015 If it's a custom wall, I recommend taking a look at other objects that can already be moved. Like the secret shelf door. Or you could use my script for moving any entity with scripting: http://www.frictionalgames.com/forum/thread-29844.html RE: It doesn't work, maybe impossible?! - Amnesiaplayer - 05-10-2015 (05-10-2015, 07:18 PM)FlawlessHappiness Wrote: If it's a custom wall, I recommend taking a look at other objects that can already be moved. Like the secret shelf door. I will try it, But I need a custom one because, Those shelf doesn't fit, It's like in temple, and then it is a little bit weird if you see a shelf standing in 1 of the X path xD (05-10-2015, 07:18 PM)FlawlessHappiness Wrote: If it's a custom wall, I recommend taking a look at other objects that can already be moved. Like the secret shelf door. I get error if I try this : void MoveWall(string &in asEntity, int alState) { if (alState == 1) { SetMoveObjectState("EgyptMove",1.0f); MoveEntityToEntity("EgyptMove", "EgyptMove_End", 0.01f, 0.01f); PlayGuiSound("quest_completed", 5); return; } } but MoveEntityToEntity("EgyptMove", "EgyptMove_End", 0.01f, 0.01f); meabs, that the wall EgyptMove, Moves UP to the EgyptMove_End (that is higher then the EgyptMove) Right?! I did this and I get error INFO: Compiling void Movewall (string&in,int) ERR: Not matching Signatures to : MoveEntityToEntity("String blabla", "stringblabla", cosnt float, const float); I think the problem is this : (string &in asEntity, int alState) That needs to be something diffirent? but what.. Couldn;t find it... |