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
Error expected method or property
Icaab2608 Offline
Member

Posts: 85
Threads: 37
Joined: Jul 2013
Reputation: 0
#21
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:

PHP Code: (Select All)
float RandFloat(float afMinfloat 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:

PHP Code: (Select All)
float f1 1.0f;

float f2 RandFloat(0.0f4.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
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#22
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
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#23
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."
(This post was last modified: 02-07-2015, 01:53 AM by PutraenusAlivius.)
02-07-2015, 01:52 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#24
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
Find
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#25
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
Find




Users browsing this thread: 2 Guest(s)