List with expressions

For questions about using Classic.

Post » Thu Apr 21, 2011 3:41 pm

Hello everyone,

Is there a list (or any other kind of resource) where I can find the different expressions that can be used in Construct? I've searched on the forum; google and sourcefourge, but didn't find anything yet..

An example of an expression: Player[Platform].VectorX

I'm looking for the expression that returns the horizontal speed of the player.
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Thu Apr 21, 2011 3:55 pm

In the expression editor, double click those little icons at the bottom. It brings up all the expressions you can use. Click the tab for platform behavior and it will show you those for the behavior.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Apr 21, 2011 3:59 pm

Awesome thanks! Didn't think to search in Construct itself..
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Thu Apr 21, 2011 3:59 pm

Hi,

is it Sprite[CustomMovement].XSpeed what you need?
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Thu Apr 21, 2011 4:12 pm

[quote="zyblade":3re02p24]Hi,

is it Sprite[CustomMovement].XSpeed what you need?[/quote:3re02p24]

Well, I've tried that one but it didn't work. I don't have Custom Movement (just Platform Movement). And Construct doesn't allow me to use Sprite[Platform].XSpeed.

I also couldn't find another option in the library. I've tried .VectorX and .Speed, but those didn't work either..

Anyone got a suggestion?


edit: I'm trying to output the horizontal speed of my main character on the screen by setting the text in the HUD. The vertical speed works ( "Vertical Speed: " & Player[Platform].VectorY )
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Thu Apr 21, 2011 4:23 pm

Add to your sprite the custom movement behavior.
(click while on layout editor on your sprite and left "behaviors --> add")
Then you can go to the event sheet editor, make a condition(like allways or whatever)
and the new action "yoursprite --> custom movement behavior --> expressions".

edit: oh ok you already edited your post^^ I was too late :)
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Thu Apr 21, 2011 4:26 pm

So in order to read out the horizontal speed, I must add a custom movement behavior?

(I'm pretty satisfied with the platform behavior and the additions I made and don't want to add unnecessary stuff)


edit: I've added the custom movement behavior, but XSpeed returns 0. So this doesn't work either.
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Thu Apr 21, 2011 7:47 pm

You are doing somthing wrong
Sprite[Platform].VectorX works fine for me
Are you sure you are using "set text" action under "Always" condition?
B
2
S
2
G
2
Posts: 158
Reputation: 1,366

Post » Thu Apr 21, 2011 8:10 pm

Here an example: http://www.mediafire.com/?xfsuzkmqnafxaxs
You don't need to add the custom movement behavior. Sometimes
it's just helpfull :)
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Fri Apr 22, 2011 9:48 am

I really don't get this, but Sprite[Platform].VectorX works now.. I've tried the exact same thing before (by typing it and by using the browser) and it only returned 0 or - then. Now it returns actual numbers..

Thanks everyone for the help. I guess I should've restarted Construct to try again or something..


edit: I know what the problem was. My text box wasn't big enough for the numbers to show.. I could either see a 0 or a - because the text box ended at that point.. Rookie mistake i'm sorry.
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests