| 
		
	
		| Icaab2608   Member
 
 Posts: 85
 Threads: 37
 Joined: Jul 2013
 Reputation: 
0
 | 
			| RE: Error expected method or property 
 
				 (02-04-2015, 05:02 PM)Mudbill Wrote:  The explanation below each of them should tell you roughly what it does. For example the first one:
 
 float RandFloat(float afMin, float afMax); 
This function will return a random value between the specified minimum and maximum values. The data type will be a float. If you know C++, you know what a float is.
 
 Let's say you have this:
 
 
 float f1 = 1.0f;
 float f2 = RandFloat(0.0f, 4.0f);
 
 if(f2 < f1) {
 //execute script.
 }
 
This example effectively returns a 20% chance of the if-statement being accepted. f1 is valued at 1, and f2 has a completely random value between 0 and 4 (inclusive). If f2 turns out to become 0, then the if-statement passes because f2 is less than f1. If f2 turns out to randomly become either 1, 2, 3 or 4, then it does not pass.
 
 That's just one example of course. I can't explain all those in detail, but they are used in combination with other scripts on the page.
 
 You should focus on the more action-like ones to get used to how they work. The ones like PlaySoundAtEntity or AddEntityCollideCallback or SetEntityActive should be interesting to check out.
 
 If there's something you don't know what does, you can either try it or just not use it. There's nothing forcing you into using every script listed.
 
And more?
			 |  |  
	| 02-06-2015, 02:56 PM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: Error expected method or property 
 
				I can't spoonfeed you this information. What I just posted accounts for all of the scripts, even if they work differently. You just gotta read what they do, then use them for what you need, if you do.
 If you wonder what the Math operations do, just google Sine, Cosine, Tangent, Square root etc.
 
 |  |  
	| 02-06-2015, 05:49 PM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| RE: Error expected method or property 
 
				 (02-06-2015, 05:49 PM)Mudbill Wrote:  If you wonder what the Math operations do, just google Sine, Cosine, Tangent, Square root etc. 
Uh, what is the function of the Sine, Cosine, Tangent operations? I know a bit of Trigonometry and that they're used for angles in a right sided triangle, but what is their purpose here?
			 
 "Veni, vidi, vici.""I came, I saw, I conquered."
 |  |  
	| 02-07-2015, 01:52 AM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: Error expected method or property 
 
				I haven't gone far enough myself to really see their practical use in the Amnesia world, but it surely only takes some imagination. If you're making a puzzle that relies on entities being located in relative positions to each other, perhaps these can come in handy. They just calculate the operation out of the values given. Math isn't exactly my fetish, so I don't see myself using these much. If I do come across a situation where it would be useful, perhaps I'll look into it.
			 
 |  |  
	| 02-07-2015, 02:11 AM |  |  
	
		| MrBehemoth   Senior Member
 
 Posts: 408
 Threads: 19
 Joined: Feb 2014
 Reputation: 
40
 | 
			| RE: Error expected method or property 
 
				Say for example you had a spooooky statue that turned to face the player, you might want to know what angle it needs to turn to. The x and z co-ords of the player and the x and z co-ords of the statue make up the adjacent and opposite sides of a right angled triangle. You could then use trig to work out the angle that the statue should be at.
 Or maybe you want to know when the player is within a certain range of angles, e.g., in the statue's line of sight.
 
 That sort of thing.
 
 (You could also use square root and good old Pythagoras to work out the distance.)
 
 |  |  
	| 02-08-2015, 07:03 PM |  |  |