| 
		
	
		| Froggit   Junior Member
 
 Posts: 20
 Threads: 4
 Joined: Feb 2012
 Reputation: 
0
 | 
			| Scripting simple button 
 
				(I'm asking for a lot)If I push a "simple button" called "simplebutton1" I want to have a secret movable bookself to move called "smb1" and have a sript area spawn for a teleporting naked guy to fly at you from the script area that just spawned called "ScriptArea_4". The teleporting naked guy is called "tng1" I know the basics of scripting but i'm really bad at scripting events, hints, prop force, ect.
 ~Thank you for any help
 
 |  |  
	| 03-04-2012, 06:36 AM |  |  
	
		| Strembitsky   Senior Member
 
 Posts: 254
 Threads: 37
 Joined: Feb 2012
 Reputation: 
3
 | 
			| RE: Scripting simple button 
 
				Use the wiki. It's your greatest friend, and you should have it open at all times while scripting.
			 
 The Nightmares v1.0  - Dreadful Fires WIP |  |  
	| 03-04-2012, 06:57 AM |  |  
	
		| Froggit   Junior Member
 
 Posts: 20
 Threads: 4
 Joined: Feb 2012
 Reputation: 
0
 | 
			| RE: Scripting simple button 
 
				 (03-04-2012, 06:57 AM)Strembitsky Wrote:  Use the wiki. It's your greatest friend, and you should have it open at all times while scripting. At the end of my post what i ment to say is that I have the scripts from Engine Scripts website BUT I dont know where to put them in my script in order to work:/
			 |  |  
	| 03-04-2012, 07:06 AM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Scripting simple button 
 
				void OnStart(){
 //callback goes here
 }
 
 //function here
 
 |  |  
	| 03-04-2012, 07:17 AM |  |  
	
		| Strembitsky   Senior Member
 
 Posts: 254
 Threads: 37
 Joined: Feb 2012
 Reputation: 
3
 | 
			| RE: Scripting simple button 
 
				That means you don't know how to script. Look up Elven's youtube video tutorials. At first, I was frustrated with the community not being able to give me a simple answer, but trust me, it's better if you learn than just asking everybody everything.
 EDIT: Or, you could do the above. >.>
 
 The Nightmares v1.0  - Dreadful Fires WIP
				
(This post was last modified: 03-04-2012, 07:18 AM by Strembitsky.)
 |  |  
	| 03-04-2012, 07:17 AM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Scripting simple button 
 
				For a simple task like telling them where things go there isn't any point to make him go through a video.
			 
 |  |  
	| 03-04-2012, 09:12 AM |  |  
	
		| Strembitsky   Senior Member
 
 Posts: 254
 Threads: 37
 Joined: Feb 2012
 Reputation: 
3
 | 
			| RE: Scripting simple button 
 
				Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction   
 The Nightmares v1.0  - Dreadful Fires WIP |  |  
	| 03-04-2012, 03:53 PM |  |  
	
		| Froggit   Junior Member
 
 Posts: 20
 Threads: 4
 Joined: Feb 2012
 Reputation: 
0
 | 
			| RE: Scripting simple button 
 
				 (03-04-2012, 03:53 PM)Strembitsky Wrote:  Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction  void OnStart() 
{ 
AddEntityCollideCallback("Player" , "ScriptArea_4" , "HallwayScare" , true , 1); 
}
 
void HallwayScare(string &in asParent, string &in asChild, int alState) 
{ 
PlaySoundAtEntity("", "27_jam.snt", "Player", 0.5f, false); 
SetEntityActive("corpse_male_1", true); 
AddPropImpulse("corpse_male_1", 0, 0, 250, "world"); 
AddTimer("look03", 2.0f, "Timer_1"); 
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0.5f, false); 
}
void Timer_1(string &in asParent, string &in asChild, int alState) {
}
 
 How do I know when to put the extra timer at the end when there is no callback |  |  
	| 03-04-2012, 04:57 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: Scripting simple button 
 
				 (03-04-2012, 04:57 PM)Froggit Wrote:   (03-04-2012, 03:53 PM)Strembitsky Wrote:  Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction void OnStart() {
 AddEntityCollideCallback("Player" , "ScriptArea_4" , "HallwayScare" , true , 1);
 }
 
 void HallwayScare(string &in asParent, string &in asChild, int alState)
 {
 PlaySoundAtEntity("", "27_jam.snt", "Player", 0.5f, false);
 SetEntityActive("corpse_male_1", true);
 AddPropImpulse("corpse_male_1", 0, 0, 250, "world");
 AddTimer("look03", 2.0f, "Timer_1");
 PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0.5f, false);
 }
 void Timer_1(string &in asParent, string &in asChild, int alState)
 {
 }
 How do I know when to put the extra timer at the end when there is no callback
 The AddTimer("look03", 2.0f, "Timer_1");  does that.
 
Also you have the wrong syntax. Change  
(string &in asParent, string &in asChild, int alState) to
 
(string &in asTimer)
			 
 
				
(This post was last modified: 03-05-2012, 04:19 AM by flamez3.)
 |  |  
	| 03-05-2012, 04:18 AM |  |  
	
		| Froggit   Junior Member
 
 Posts: 20
 Threads: 4
 Joined: Feb 2012
 Reputation: 
0
 | 
			| RE: Scripting simple button 
 
				 (03-05-2012, 04:18 AM)flamez3 Wrote:   (03-04-2012, 04:57 PM)Froggit Wrote:  The AddTimer("look03", 2.0f, "Timer_1"); does that. (03-04-2012, 03:53 PM)Strembitsky Wrote:  Fair point, but if it's something as basic as that, it means they have no idea how to script. I thought I would send them in the right direction void OnStart() {
 AddEntityCollideCallback("Player" , "ScriptArea_4" , "HallwayScare" , true , 1);
 }
 
 void HallwayScare(string &in asParent, string &in asChild, int alState)
 {
 PlaySoundAtEntity("", "27_jam.snt", "Player", 0.5f, false);
 SetEntityActive("corpse_male_1", true);
 AddPropImpulse("corpse_male_1", 0, 0, 250, "world");
 AddTimer("look03", 2.0f, "Timer_1");
 PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0.5f, false);
 }
 void Timer_1(string &in asParent, string &in asChild, int alState)
 {
 }
 How do I know when to put the extra timer at the end when there is no callback
 
 Also you have the wrong syntax. Change
 (string &in asParent, string &in asChild, int alState) to
 
 (string &in asTimer)
 Damn your good lol. I put the wrong syntax there o npurpouse cause I couldnt find the corrct onexD
			 |  |  
	| 03-05-2012, 04:44 AM |  |  |