SexScripts : Help the new guy out? - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=706 Page 1 of 1

Help the new guy out?

Tryingtocode [ Sun Aug 06, 2017 12:03 am ]

Hi all.

Completely new to this so I figured i would try my hand with the script maker tool. So for it is going well, but i have come to a stop as i cant figure out how to get something to work.

There is a button which lets you use percentages to decide outcomes. I have tried to get it so that there is a 65% chance of xyz, but it wont work. Any help would be greatly appreciated.

Re: Help the new guy out?

doti [ Sun Aug 06, 2017 11:48 am ]

Can you post the content of the .ssm file here ? (it is in the ssMakerScripts directory)

Re: Help the new guy out?

Tryingtocode [ Sun Aug 06, 2017 6:29 pm ]

Thanks for the reply. i think this should do it. is it the right format? said i cant attach the .ssm file so here is the . groovy file

Attachments:
Test 1.groovy [4.54 KiB]
Downloaded 1697 times

Re: Help the new guy out?

doti [ Mon Aug 07, 2017 10:14 am ]

It looks good
Show spoiler

Re: Help the new guy out?

Tryingtocode [ Mon Aug 07, 2017 10:38 am ]

It works correctly? just unsure as 1st time

Re: Help the new guy out?

doti [ Mon Aug 07, 2017 10:52 am ]

Perhaps there's a problem : there are 3 consecutives tests (65%, 25%, 10%), but not related. THat is, it can show both of them, or none of them, for example. You should avoid this with "Else case"
Code:
If ...
...
Else
. If ...
. ...
. Else
. ...

Re: Help the new guy out?

Tryingtocode [ Mon Aug 07, 2017 11:51 am ]

How would I go about changing that so I could still use all 3 possibilities?

Re: Help the new guy out?

doti [ Mon Aug 07, 2017 1:09 pm ]

With the "Else" like above ; it should replace the 3 successive "If".

Re: Help the new guy out?

Tryingtocode [ Mon Aug 07, 2017 2:27 pm ]

Thanks for the tip, although im unsure of how to do this. Because i have no idea of the actual coding, i am using the building program, which only lets me use the "If a chance is met" command. that s why there is he repetitive statements

Re: Help the new guy out?

Tryingtocode [ Mon Aug 07, 2017 2:38 pm ]

would this be right? i put the else command in, would you check that it is right please

Quote:
else
if(getRandom(100) < 25) {
blah blah blah...


Attachments:
Test 1 Edit.groovy [4.35 KiB]
Downloaded 1557 times

Re: Help the new guy out?

doti [ Mon Aug 07, 2017 3:02 pm ]

Yes, looks good.

Perhaps the last test (10%) is superfluous. If not the first case and not the 2nd case, always the third.

Re: Help the new guy out?

athos316 [ Sun Sep 17, 2017 8:07 pm ]

Something doesn't add up for me...

In regards to the:
else
if(getRandom(100) < 25) {
blah blah blah...


If you use "(getRandom)" each time, won't that set a new random number? Shouldn't you first set a variable "Percent" (or something) to the value of the getRandom(100) statement? Then test the variable for its value.

:roll:

Page 1 of 1 All times are UTC + 1 hour [ DST ]
https://ss.deviatenow.com:443/
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2011