How do I check a range in an array? [RESOLVED]

Get help using Construct 2

Post » Tue Aug 07, 2012 8:25 pm

Yann has a set of wonderful suggestions here:

http://www.scirra.com/forum/dialog-system_topic47748_page1.html

for building a dialog system. Because I'm ignorant, I'm having a hard time getting them working, though.

Yann suggests setting up a 3D array, and the array contains value RANGES. I.e., 0-20.

I don't know how to test a global variable to see if it fits in a range.

I also feel like I'm doing something wrong, because I can't get my options to display correctly from the secondary array. Here's my attempt so far:

https://dl.dropbox.com/u/7066157/dialog.capx

"After that it's just a matter of calling the dialog, parsing the first part of the string to see what match the parameters of your player (might have to be more exclusive than what I did) and then displaying the corresponding sentence. And using the end of the string for possible answers. etc."
tss00042012-08-07 21:22:56
B
4
Posts: 6
Reputation: 587

Post » Tue Aug 07, 2012 8:49 pm

first, I think I should have made clear that all should be string
0-20 = -20
you should use "0-20"

Then to get the min and max values it's juste tokens
so you just have to compare your values like this:
value < int(tokenat(range,0,"-"))
value > int(tokenat(range,1,"-"))
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Aug 07, 2012 9:21 pm

Hey, I got it! Thank you so much for the explanation and the help!!!
B
4
Posts: 6
Reputation: 587


Return to How do I....?

Who is online

Users browsing this forum: onzephyr and 22 guests