sc2c.org

Go Back   Sc2C.org > Developer's Corner > Scripting
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 08-17-2010, 09:48 AM   #11
Anitarf
Procrastination incarnate
 
Join Date: Jul 2010
Posts: 28
Default

When looping, x should probably go from curIndex to WordListCurMax-1 instead of what you have there now. However, you can avoid the loop altogether.

Actions
Variable - Set WordListCurMax = (WordListCurMax - 1)
Variable - Set curIndex = (Random integer between 0 and WordListCurMax)
Variable - Set curWord = WordList[curIndex]
Variable - Set WordList[curIndex] = WordList[WordListCurMax]
General - Return curWord
Anitarf is offline   Reply With Quote
Old 08-17-2010, 04:30 PM   #12
pinzu
Junior Member
 
Join Date: Jul 2010
Posts: 8
Default

I don't see how that would colapse the arry.

Anyway the problem I have now is that I want to have a event that checks when that generated word is used.

and when its used it should be readded to the pool.

**EDIT**

the system works perfectly now! dissregard all previous questions, thank you.

Last edited by pinzu : 08-17-2010 at 08:43 PM.
pinzu is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:03 PM.


Powered by vBulletin
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.