Ryandor.com
http://www.ryandor.com/forum/

Quest-type questions...
http://www.ryandor.com/forum/viewtopic.php?f=4&t=2803
Page 2 of 2

Author:  Stormcrow [ Wed May 10, 2006 9:08 pm ]
Post subject: 

Dian wrote:
a poor job of coding. look at the huge length of if statements.. thats typicall of a new scripter, trying to accomplish something complex.. not knowing much of anything about the language.


Yeah, that was what it looked like to me but pretty much being in the same boat as "new scripter.....not knowing much of anything about the language" myself I wasn't about to say it outloud :P

I can see what the random doulbe is for, I just can't see why it is basicly repeated so many times, surely there is a way to accomplish the same effect with less code. It is giving a chance of doing extra damage with slightly different parameters for each....I think. People always seem to forget keep it simple stupid.

Author:  RoseThorn [ Thu May 11, 2006 5:32 am ]
Post subject: 

hehe, well they're all ungodly long, that was just the first one I happened to click on. Anyways, I have nothing bad to say about RunUO as I've never used it myself to get an opinion, but I can honestly say I'd never use it after seeing the length and BS required for anything to be scripted in it. I have way too many scripts to even consider it unfortunately :p

oh, if (rand(100) <= 40) :p

Author:  Xuri [ Thu May 11, 2006 8:35 am ]
Post subject: 

The possible UOX3 variants:
Code:
   //Random number from 0 to 1 using javascript's built in math.random function
   var rndValue1 = Math.random();

   //Random number from 1 to 20 using javascript's math functions         
   var rndValue2 = Math.round( 20 * Math.random());
   
   //Random number from 1 to 100 using UOX3-specific method
   var rndValue3 = RandomNumber( 1, 100 );

   //Random number using UOX3's DnD-style dicethrows - in this case 3d6 + 0      
   var rndValue4 = RollDice( 3, 6, 0 );

//And now to do what Rose did:
Code:
   if( rndValue3 > 40 )
   
   //or:
   if( RandomNumber( 1, 100 ) > 40 );
:)

Page 2 of 2 All times are UTC - 7 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/