| 
		
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| It doesn't work, maybe impossible?! 
 
				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...
 |  |  
	| 05-09-2015, 07:03 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				Is the lever the correct name?Are you sure you're pulling the lever up?
 
 Trying is the first step to success. |  |  
	| 05-09-2015, 09:03 PM |  |  
	
		| Daemian   Posting Freak
 
 Posts: 1,129
 Threads: 42
 Joined: Dec 2012
 Reputation: 
49
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				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.
 
 |  |  
	| 05-10-2015, 02:38 AM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				 (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    
 Trying is the first step to success. |  |  
	| 05-10-2015, 03:04 AM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				I'm sure the thing it self didn't work because the Playgui sound didn't played tho...
			 |  |  
	| 05-10-2015, 03:17 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				 (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.
			 
 Trying is the first step to success. |  |  
	| 05-10-2015, 03:24 PM |  |  
	
		| Radical Batz   Posting Freak
 
 Posts: 953
 Threads: 145
 Joined: Dec 2013
 Reputation: 
25
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				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
 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.
			
 
				
(This post was last modified: 05-10-2015, 03:42 PM by Radical Batz.)
 |  |  
	| 05-10-2015, 03:40 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				 (05-10-2015, 03:40 PM)Mr. Badcatz Wrote:  FirstlyYou 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
 
 
 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.
 
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..?
			 
				
(This post was last modified: 05-10-2015, 06:39 PM by Amnesiaplayer.)
 |  |  
	| 05-10-2015, 05:59 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				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
 Trying is the first step to success. |  |  
	| 05-10-2015, 07:18 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: It doesn't work, maybe impossible?! 
 
				 (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.
 Or you could use my script for moving any entity with scripting:
 http://www.frictionalgames.com/forum/thread-29844.html
 
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.
 Or you could use my script for moving any entity with scripting:
 http://www.frictionalgames.com/forum/thread-29844.html
 
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...
			 
				
(This post was last modified: 05-10-2015, 07:39 PM by Amnesiaplayer.)
 |  |  
	| 05-10-2015, 07:28 PM |  |  |