Author Topic: Quick rand-multiple-of question  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Quick rand-multiple-of question
Working on a mission the other night I think I was over thinking how rand-multiple-of works.  If I say do the following

when-argument (repeat say 5 times)
--rand-multiple-of
--->(list of say 20 different items)
--true
--modify-variable
---->(whatever)
----><argument>
--invalidate-argument
----<argument>

Will it pick 5 different things out of the list or can there be duplicates? 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Quick rand-multiple-of question
Rand-multiple-of (in fact all the -of SEXPs) will only pick a valid argument. Since you're invalidating the argument you've just picked you shouldn't see a duplicate.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Quick rand-multiple-of question
That's what I was starting to think but wanted to make sure.  I think I confused myself when I made that random gauntlet that did allow for multiple hits using variables and rand-multi.  Well anyways it will the event it was using it for much cleaner to look at and edit.  It works the way I wrote but it isn't pretty.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras