Author Topic: random numbers becoming local variables?  (Read 380 times)

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
random numbers becoming local variables?
« on: August 02, 2011, 08:11:55 pm »


               I'm working on an idea I have for a script (and want to do the actual scripting of most of the product), but I'm lost on how to implement a dice roll (a d3) and storing the number as a local variable.  If you can give me just that little snippit, I should be able to write the rest of it (and then show off the idea that I've got on the vault).

thanks in advance for the information.

Alassirana
               
               

               
            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #1 on: August 02, 2011, 08:19:33 pm »


               nRoll = d3();
SetLocalInt(oObject, nRoll);
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #2 on: August 02, 2011, 08:36:46 pm »


               Thank you so very much...hopefully I'll get the rest of this scripted and on the vault today...it's the idea for a fully functional 3 cup shell game....complete with spot check option.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #3 on: August 02, 2011, 08:46:04 pm »


               Sounds nice.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #4 on: August 02, 2011, 10:11:31 pm »


               

_Knightmare_ wrote...

nRoll = d3();
SetLocalInt(oObject,?? nRoll);


*caugh*

try,   SetLocalInt(oObject,"VarName" ,nRoll);
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #5 on: August 02, 2011, 10:20:53 pm »


               I'll double check, but I think that I did have it fixed in my copy, but thanks.
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #6 on: August 02, 2011, 10:22:51 pm »


               Yep, I had it correct.
               
               

               
            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #7 on: August 03, 2011, 01:07:10 am »


               

Lightfoot8 wrote...

_Knightmare_ wrote...

nRoll = d3();
SetLocalInt(oObject,?? nRoll);


*caugh*

try,   SetLocalInt(oObject,"VarName" ,nRoll);





DOH!!! Good catch. I even read it back to myself and didn't notice... That's what I get for typing with one hand and trying to deal with a 3 month old baby with the other... 'Image
               
               

               
            

Legacy_Alassirana

  • Full Member
  • ***
  • Posts: 103
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #8 on: August 03, 2011, 01:21:41 am »


               That's quite all right.  Good luck with the baby.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
random numbers becoming local variables?
« Reply #9 on: August 03, 2011, 01:37:18 am »


               

_Knightmare_ wrote...

... That's what I get for typing with one hand and trying to deal with a 3 month old baby with the other... 'Image


Been there done that....twice. '<img'>
               
               

               


                     Modifié par GhostOfGod, 03 août 2011 - 12:37 .