Odd quirks with randomtest

Just been running randomtest on my edited version of UnNatural. and came across an odd error, it’d throw up an error message regarding a token exception yet running it again it seems to pass. this has happened a few times this evening. First it was giving an error that *selectable_if wasn’t a valid command so i switched it to an *if and now get the token error.

Is there something with randomtest that can fail something but pass it on a second test?

Hmm, I’m curious. How does the line looks at the part where the error occurs?

As a note, you can’t put *if on the same line with the #choice, if that makes sense :frowning_face:

That’s an unusual one.

Random test plays through one iteration of your game. It may not take the path that the error is in. It’s better to test with quick test first, then when that passes, move to random test.

It passes quick test fine which is why I’m confused.

That could be an issue as *selectable_if is usually on the same line and I just changed it to an *if.

I’ll try Changing it later.

1 Like

It sounds like the code for the selectable_if has been placed incorrectly. Selectable_if, by its nature, is obviously only usable in a choice and the error is asifits being used in the wrong place. If you want to post the code we can take a look.

Another thought: as the error appears sometimes but not all… yet it passes quick test, is your choicescript uptodate and accurate? It might be worth downloading the latest version. Be sure only to copy the scenes folder and any images / sound files across. Don’t copy the index.html file.

I’m sure you have already thought of these but doesn’t hurt to say just in case :slight_smile:

2 Likes

I’ll post the code in a minute. Just got back home from doing a shopping run.

      *if (form > 20) 
        #I create a scythe out of shade.
          *set form_weapon form_scythe
          *set form_scythe %+5
          *if (physical + werewolf_lore) >50
            You swing the scythe in a deadly arch. The curved blade buries itself into the beast's side. 

            You twist it, before bringing the blade up suddenly. The vicious motion splits the wolf, and his heart, in two.      
            *goto wolf_corpse
          *else
            *if (rapport >25)
              *goto save_me
            You try to slash the werewolf, but he avoids your clumsy attack. The werewolf bats the weapon aside, tackling you to the ground. You land hard. The weapon dissipates, and you can't bring it back quickly enough to stop the beast's pounce. You scream as he digs sharp claws into your body. Struggling is useless. A violent swipe of his claw tears your throat open. The last thing you feel is his hot breath and a sharp pain in your side.
            *if save_game = true
              *page_break Restart Episode Three Part Two
              *set save_flag 2
              *set return_to_scene "threea"
              *goto_scene savegame
            *else
              *ending

I had left the *if on the same line so i dropped it to the next line and now get the error about dropping out an *if block,

I’m using CSIDE atm so am waiting for the new version to get updated,

I don’t know if you already solved the problem but I got this and after banging my head through all different types of material, finally found out that my problem was that I only had *selectable_if choices. I.e

*selectable_if (Rude >=50) #You say something mean.
*selectable_if (Deceit >=50) #Do something deceitful.

I didn’t have a choice for if none of those were actually true. So I had to just add a plain choice as well.


*selectable_if (Rude >=50) #You say something mean.
*selectable_if (Deceit >=50) #Do something deceitful.
#Just say something random.

That was my problem every time it popped up anyway.

Just posted it in my previous post. :slight_smile:

1 Like

Alright so correct me if I’m wrong but isn’t the choice supposed to be up there with the *if, so like

*if (form >20) #I create the scythe out of shade

Normally it works so unless thats been changed?

Shouldn’t the last *else command be on the same indentation as the first *if? As it is shown, you have an extra indentation, putting it in further …

Might be one of those things that can work either way cos I always do it the other way. What does your other choice for the section look like as well?

I don’t think so as the code under the *else is another *if and *else for the save bit.

1 Like

I put it on same line and the token error has gone. That just leaves the original odd error. Just running Random test again to see if I can find it again.

Random test has always run slow for me so just bare with me. On seed 1450 now.

1 Like

Waiting for the moment, ey? :wink:

I find it goes quicker if you don’t show choices or text then if it errors just do choices/text for the deed that error.

Edit: just errored on seed 1928 invalid expression couldn’t extract another token. Now running Random test on seed by itself and it passes. This is the odd quirk i found

Maybe try deselecting the ‘avoid used options’ button and see if that affects the odd quirk? Or start at seed 1900 and see if you hit the error?

It may be that the seeds play out in a different order depending on how many used options they’ve been through in previous iterations and are now avoiding. (Although I don’t know, I’m really just guessing and may be way off here.)

Also, have you tried following the choice tree up to that error and then using CSIDE’s step through function to figure out exactly what is causing the bug? I’ve caught a few errors that way that I was having quite a lot of trouble catching, ones that passed Quicktest but not Randomtest.

1 Like

nope it still passed. This is REALLY weird.

edit: I’ve never used the step through function before but its worth a try.

1 Like