Gorgonzola Posted February 20, 2019 Share Posted February 20, 2019 Hi, i just wanted to know if there is a way for the random_int_in_ranges to pick a value from a set of separated values: Something like this: random_int_in_ranges 201, 206, 212, 221, 230 What i want to explain is that, between that 5 sole numbers, i want the script to choose one, no ranges, just single vaues. Is that possible? Link to comment Share on other sites More sharing options...
guard3 Posted February 20, 2019 Share Posted February 20, 2019 I’m not familiar with sanny format, but you can generate random numbers from 0-5 and then if ... == 0 select 201 else if ... == 1 select 206 etc etc Link to comment Share on other sites More sharing options...
ZAZ Posted February 20, 2019 Share Posted February 20, 2019 (edited) 12 hours ago, Gorgonzola said: Hi, i just wanted to know if there is a way for the random_int_in_ranges to pick a value from a set of separated values: Something like this: random_int_in_ranges 201, 206, 212, 221, 230 You can realize it together with opcode 0871: 0209: 0@ = random_int 0 4 0871: init_jump_table 0@ total_jumps 5 0 @TBL_01 jumps 0 @TBL_01 1 @TBL_02 2 @TBL_03 3 @TBL_04 4 @TBL_05 -1 @TBL_05 -1 @TBL_05 :TBL_01 0@ = 201 jump @TBL_END :TBL_02 0@ = 206 jump @TBL_END :TBL_03 0@ = 212 jump @TBL_END :TBL_04 0@ = 221 jump @TBL_END :TBL_05 0@ = 230 jump @TBL_END :TBL_END read here more about jumptable Edited February 20, 2019 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now