Nyx. Problems with the range command

Post all technical issues and questions here. We'll gladly help you wherever we can.
Xenophobe
Explorer
Explorer
Posts: 92
Joined: Sat Jul 07, 2007 1:42 pm

Nyx. Problems with the range command

Post by Xenophobe »

I can't seem to use the "range" command. I want nyx to rotate randomly between a set of pages after a delay. Am I simply using the command wrong? Here's my code:

Code: Select all

start#page('This is the beginning',pic("*.jpg"),buttons(3#, "Continue"));

3#page(
'3',
pic("*.jpg"),
delay(10sec,range(3,5))
);

4#page(
'4',
pic("*.jpg"),
delay(10sec,range(3,5))
);

5#page(
'5',
pic("*.jpg"),
delay(10sec,range(3,5))
);
I tried adding a "#" after the range command but that doesn't work. I've also just tried using range on its own, within a "buttons" command, and a "go" command, to no avail. Am I doing something wrong?
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

Looks right to me. Can you give me the ID of the tease where you're trying it out please?
User avatar
Evals
Explorer At Heart
Explorer At Heart
Posts: 432
Joined: Mon May 07, 2007 2:42 am
Gender: Male
Sexual Orientation: Straight
I am a: Submissive
Dom/me(s): Owned

Re: Nyx. Problems with the range command

Post by Evals »

From my experimentation, the range() function only worked inside the go() function. Anything else wouldn't work.
Evals
Image
Xenophobe
Explorer
Explorer
Posts: 92
Joined: Sat Jul 07, 2007 1:42 pm

Re: Nyx. Problems with the range command

Post by Xenophobe »

I've got two tests going: 3142 and 3154. Thanks for taking a look.

A better description of what happens:
If range is used inside a delay function, best case scenario is that after a few jumps the delay stops counting (the timer remains at zero but the animation [the sweeping second hand] continues for about 10 s but the page never changes again).

If range is used inside a go function, best case scenario is that after a few jumps the pages just stop changing.
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

Alright, so here is a bit of info about the range command. We added it when we were converting House of Tease 2. So it's emulating the behavior of PCM, which is that every page is only displayed once by default. After that it's considered set and ignored in future range() commands. If all actions in the range are set, the range command fails entirely.

So, try this:

Code: Select all

3#page('Text', pic('*.jpg'), delay(10sec, range(3, 5)), hidden:unset(3#));
4#page('Text', pic('*.jpg'), delay(10sec, range(3, 5)), hidden:unset(4#));
5#page('Text', pic('*.jpg'), delay(10sec, range(3, 5)), hidden:unset(5#));
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

As a more general tip: If you're having problems with any particular script, there's often something interesting in the debug console.

Just drag this handle to the right to open it:
Image
Xenophobe
Explorer
Explorer
Posts: 92
Joined: Sat Jul 07, 2007 1:42 pm

Re: Nyx. Problems with the range command

Post by Xenophobe »

Wow, that's awesome. Thanks for explaining that to me and pointing out the debug console - I remember reading about it but couldn't figure out how to find it. Thanks!
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

Xenophobe wrote:Wow, that's awesome. Thanks for explaining that to me and pointing out the debug console - I remember reading about it but couldn't figure out how to find it. Thanks!
Sure thing! You're welcome. :-)
User avatar
avatarbr
Experimentor
Experimentor
Posts: 1239
Joined: Fri Aug 18, 2006 3:33 am
Gender: Male
Sexual Orientation: Straight

Re: Nyx. Problems with the range command

Post by avatarbr »

I also have problem with range command.

I try all this tips, and alway get a error (command invalid).
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

avatarbr wrote:I also have problem with range command.

I try all this tips, and alway get a error (command invalid).
Post some code or give me the ID of the tease you're working on and I'll see if I can help you out. :-)
User avatar
avatarbr
Experimentor
Experimentor
Posts: 1239
Joined: Fri Aug 18, 2006 3:33 am
Gender: Male
Sexual Orientation: Straight

Re: Nyx. Problems with the range command

Post by avatarbr »

seraph0x wrote:
avatarbr wrote:I also have problem with range command.

I try all this tips, and alway get a error (command invalid).
Post some code or give me the ID of the tease you're working on and I'll see if I can help you out. :-)
Current Tease: #3550.

That´s it?

I dont know if the problem is the numbers of the pages. I use default names (page2#, Page3#...).

I try with complet name (page2#), only the number (2), only (page2). Try range () and go (). Comma and space. Nothing works :(

Another question: must and mustnot. We have this commands in Nyx?


OBS: I cant upload images with Firefox. Only in Internet Explorer. Miss anything?
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

avatarbr wrote:
seraph0x wrote:
avatarbr wrote:I also have problem with range command.

I try all this tips, and alway get a error (command invalid).
Post some code or give me the ID of the tease you're working on and I'll see if I can help you out. :-)
Current Tease: #3550.

That´s it?

I dont know if the problem is the numbers of the pages. I use default names (page2#, Page3#...).

I try with complet name (page2#), only the number (2), only (page2). Try range () and go (). Comma and space. Nothing works :(
If your pages are named page1#, page2#, page3#, the correct range() command is range(1,3,'page').
avatarbr wrote:Another question: must and mustnot. We have this commands in Nyx?
Yes and yes.

These have to be defined outside of any page, like so:

Code: Select all

page1#page("blah", ...)

must(page2#, page1#)
page2# will only be considered for a range() command if page1# is set.

A word of warning: Nyx works really well for simple multiple choice (i.e. the stuff you can do with the Visual tab), anything else will be fairly tedious. Then again, it's probably about as tedious as developing for PCM.
avatarbr wrote:OBS: I cant upload images with Firefox. Only in Internet Explorer. Miss anything?
Perhaps you have a different version of Flash installed in Firefox, try upgrading?

Cheers,

Seraph0x :-)
User avatar
avatarbr
Experimentor
Experimentor
Posts: 1239
Joined: Fri Aug 18, 2006 3:33 am
Gender: Male
Sexual Orientation: Straight

Re: Nyx. Problems with the range command

Post by avatarbr »

Thanks for the help, seraph0x
seraph0x wrote:
If your pages are named page1#, page2#, page3#, the correct range() command is range(1,3,'page').
I try this:

Code: Select all

start#page(
'text',
pic("ash013.jpg"),
delay(2sec, range(2,3,'page'))
);

page2#page(
'text',
pic("ash014.jpg"),
go(page3#)
);

page3#page(
'text',
pic("ash015.jpg"),
delay(10sec, page4#,style:secret)
);
And get this error: Error: Action not found: null

What I wrong? :-/
seraph0x wrote:

Code: Select all

page1#page("blah", ...)

must(page2#, page1#)
page2# will only be considered for a range() command if page1# is set.
Let me see.

must(page2#, page1#)

The first item (page2#), depends the second item (page1#)?

I´m confusing :lol:

In PCM, we have this case:

Code: Select all

[Action 1]
bla bla
.range 2 3 

[Action 2]
bla bla
.must 3
.range 10 10

Page 3 must be load first. In the second time, Page 2 can be loaded too.

To this works in Nyx, I get this?

Code: Select all

page1#page("blah", ...)
must(page2#, page3#)
range (2,3)

page2#page("blah", ...)
range (10)
PCM version = must command in page 2
Nyx version = must command in page 1 (with the range command)

If Page 2 need page 3 AND page 4, I can use this?

Code: Select all

must(page2#, page3#, page4#)
seraph0x wrote:A word of warning: Nyx works really well for simple multiple choice (i.e. the stuff you can do with the Visual tab), anything else will be fairly tedious. Then again, it's probably about as tedious as developing for PCM.
yeah. But I like PCM code :lol:

If I dominated Nyx code, can make flash teases in notepad and just past in script tab.
seraph0x
Administrator
Administrator
Posts: 2666
Joined: Sun Jul 23, 2006 8:58 am

Re: Nyx. Problems with the range command

Post by seraph0x »

avatarbr wrote:I try this:

Code: Select all

start#page(
'text',
pic("ash013.jpg"),
delay(2sec, range(2,3,'page'))
);

page2#page(
'text',
pic("ash014.jpg"),
go(page3#)
);

page3#page(
'text',
pic("ash015.jpg"),
delay(10sec, page4#,style:secret)
);
And get this error: Error: Action not found: null
Try this please: range(2,3,prefix:'page')
avatarbr wrote: Let me see.

must(page2#, page1#)

The first item (page2#), depends the second item (page1#)?
Exactly.
avatarbr wrote:
To this works in Nyx, I get this?

Code: Select all

page1#page("blah", ...)
must(page2#, page3#)
range (2,3)

page2#page("blah", ...)
range (10)
PCM version = must command in page 2
Nyx version = must command in page 1 (with the range command)
Wahh, nono. The must command does not appear in any page!! So correcting your example:

Code: Select all

1#page(
  "blah",
  ...,
  range(2,3)
)
2#page(
 "blah",
 ...,
 range(10)
)

must(2#, 3#)
You can put the must() anywhere. You can put it right after the page or at the end of the script, or at the beginning of the script, anywhere. But it must not be in any page, meaning inside of the braces of the page() command.

Please note, that while the commands similar to PCM are available, the syntax of FlashTease script is much more like C, Java or a related language. For instance, the order of the commands in PCM doesn't matter. In Nyx it does (unless you specify them by name.)

I strongly recommend that you read the Scripting Tutorial if you haven't done so!
avatarbr wrote:If Page 2 need page 3 AND page 4, I can use this?

Code: Select all

must(page2#, page3#, page4#)
Yep. :-)
User avatar
avatarbr
Experimentor
Experimentor
Posts: 1239
Joined: Fri Aug 18, 2006 3:33 am
Gender: Male
Sexual Orientation: Straight

Re: Nyx. Problems with the range command

Post by avatarbr »

seraph0x wrote:
Try this please: range(2,3,prefix:'page')
Yes, this works. :-D

But, when I try test again, I not could unset the actions.

Code: Select all

Error: Range failed: All actions set!
I need close and open Nyx again to test again. Have another way to reset actions? The RESET buttom dont do this.

And other problem. If I use the Visual Editor after edit in scrip tab, this line is changed to this:

Code: Select all

delay(2sec, range(2,3,prefix:'page')#)

About must command, I understood now. Thanks :-) I will take a loon in the manual....later
Post Reply