Gah, how do I explain this? Text Values?

For questions about using Classic.

Post » Thu Jun 17, 2010 12:18 am

Hi guys! It's joeyapplepi, back from a long hiatus from game making. I'm trying my hand at a different game now, an RPG, but I can't seem to figure out how to do something.

Basically, my aim is to have the level of the enemy you're fighting appear in the text that scrolls during the battle. For instance:

"You encounter a level [insert enemy level here] foe!"

The problem is, every time I try to put the value in between the quotes, it simply reads it as part of the dialog. Is there any way to separate the dialog from the variable being picked out of the enemy object? :P
B
4
S
1
G
2
Posts: 54
Reputation: 958

Post » Thu Jun 17, 2010 12:42 am

[code:2eyvqjr4]"You encounter a level " &EnemyLevel + " foe!"[/code:2eyvqjr4]

&EnemyLevel would be your value with the & symbol before it.

Include spaces within the quotes.
B
2
S
2
G
4
Posts: 156
Reputation: 1,762

Post » Thu Jun 17, 2010 12:47 am

Also, the wiki has a couple of examples of using the two different operators (+ and &), under 'Building strings with &' on this page:

[url:373vjiy8]http://sourceforge.net/apps/mediawiki/construct/index.php?title=Expressions[/url:373vjiy8]

There are a few handy bits of info on that page.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Thu Jun 17, 2010 12:48 am

Yes, certainly look at the Wiki first when you are stuck with something :)

While not complete, it's a great starting point!
B
2
S
2
G
4
Posts: 156
Reputation: 1,762

Post » Thu Jun 17, 2010 1:05 am

Thanks guys. :) I appreciate the help!
B
4
S
1
G
2
Posts: 54
Reputation: 958


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest