de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 'Jumping back' to a previous part/line in a script?
PostPosted: Wed Aug 03, 2011 10:20 am 
Offline
Veteran
User avatar
Is it possible? Given the way the Cybermistress conversions output, I presume so, but I have NO idea how to set it up from scratch! I only need it for a part of the script, too.

Example: in Spanking Dice... if you don't have a certain toy, it lets you "reroll"... which would mean 'going back' a few code lines to rerun them and try for a different random result.

Is this what the codes 'case' and 'switch' might be used for? Sorry, I have no idea here! :(


Top
 Profile Send private message 
 
 Re: 'Jumping back' to a previous part/line in a script?
PostPosted: Wed Aug 03, 2011 7:22 pm 
Offline
Site Admin
User avatar
Ol' programmer would call that à "GOTO" ; it was good in CM, because of the simplicity, but for SexScripts, it would be in fact a burden. But : there is a solution that is a little bit more complicated : a loop.
For your example :
Code:
def reroll = true
while (reroll) {
  reroll = false
  ...
  if(...ihavenotthetoy....) reroll = true
  ...
}


Top
 Profile Send private message 
 
 Re: 'Jumping back' to a previous part/line in a script?
PostPosted: Sat Aug 06, 2011 6:53 am 
Offline
Veteran
User avatar
A little complicated for what should ideally be more simple, but works perfectly in this case. Thanks!

I remember 'goto' from (very) old BASIC, I think... :)


Top
 Profile Send private message 
 
 Re: 'Jumping back' to a previous part/line in a script?
PostPosted: Sun Aug 14, 2011 11:19 pm 
Offline
Regular
I am confused on this same subject. If one goes through a scenario a certain number of times I want the program to then skip ahead to another scenario. At the same time if one has not gone through the scenario enough times how do I get the program to return them to it so that they go through it again.

Example:

Once the sub has gone through a particular section of the program 3 times I want them to go to the next stage of the program. However, if is their first, second, I want them to go back to the start of this particular section when completed.

Next stage could be another script if that is easier. In cm it was if it was one way then the next "block" would be x, but if it was the other way (i.e. already three times through) next would be y.

Thanks.


Top
 Profile Send private message 
 
 Re: 'Jumping back' to a previous part/line in a script?
PostPosted: Mon Aug 15, 2011 10:44 am 
Offline
Site Admin
User avatar
It should be a loop, Do 3 times ...

That is :
Code:
// new variable "i" start at 0, loop while less than 3, adding 1 each time
for(def i = 0; i < 3 ; i++) {
   //dosomething
}


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.