# How do I Function Parameters

Get help using Construct 2

### » Thu May 15, 2014 9:17 pm

Hey there,
I have been playing around with the Function plugin and it's a beautiful thing, haha. But, I came across two things that appear to mean the same thing. If you take a look at the screenshots below you'll see what I mean. There are two different ways of calling a parameter? What's the difference between the two?
You do not have the required permissions to view the files attached to this post.
B
59
S
15
G
13
Posts: 826
Reputation: 17,860

### » Fri May 16, 2014 12:30 am

When you are using "Compare parameter" (the event), you just have to entre the index of the parameter (0, or 1 or 2, or whatever parameter you want to compare to something).

So if you set Index to 0, comparison to Equal, and Value to 1 for exemple, the condition will be true if the First parameter (it's zero based..) is equal to 1

Function.Param(Index) however is the value of the parameter itself, which can be use in various ways inside the function (like inside a math formula, or to pick a particular instance of an object, or to return a particular result)

In theory you could compare the value of a parameter by using System>Compare Two Values : Function.Param(0) is equal 1
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
23
G
18
Posts: 2,123
Reputation: 17,200

### » Fri May 16, 2014 12:30 am

The first is a condition and used as any other type of comparison and the other is an expression and returns only the value of the specified index .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

### » Fri May 16, 2014 12:31 am

We must have submitted at the same time @ aphrodite
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499