Aller au contenu

Photo

random numbers becoming local variables?


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
Alassirana

Alassirana
  • Members
  • 55 messages
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

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
nRoll = d3();
SetLocalInt(oObject, nRoll);

#3
Alassirana

Alassirana
  • Members
  • 55 messages
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.

#4
Baragg

Baragg
  • Members
  • 271 messages
Sounds nice.

#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

_Knightmare_ wrote...

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


*caugh*

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

#6
Alassirana

Alassirana
  • Members
  • 55 messages
I'll double check, but I think that I did have it fixed in my copy, but thanks.

#7
Alassirana

Alassirana
  • Members
  • 55 messages
Yep, I had it correct.

#8
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

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 IPB

#9
Alassirana

Alassirana
  • Members
  • 55 messages
That's quite all right. Good luck with the baby.

#10
GhostOfGod

GhostOfGod
  • Members
  • 863 messages

_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 IPB


Been there done that....twice. ;)

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