How do I make a "Tips" trigger like in mauls in a random order?

ZelNaga

New Member
Reaction score
5
As the name states I would like to add Tips to my map but I don't know how I could set it up so they appear in a random order.
 

nardretor

New Member
Reaction score
6
I think you will use string variable with array. Set it. Then every XX seconds, display to all players the (variable [random integer between 1 and number of tips])
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Event:
- Map init
Conditions:
Actions:
- Set Tips[1] = This ...
- Set Tips[2] = That ...
- Set Tips[3] = Something ...
- Set Tips[4] = Whatever ...
- Set TipsCount = 4

Event:
- Time - Every 20.0 seconds
Conditions:
- TipsCount greater than 0
Actions:
- Set TempInteger = Random integer between 1 and TipsCount
- Game - Display to (All players) the text: Tips[TempInteger]
- Set Tips[TempInteger] = Tips[TipsCount]
- Set TipsCount = TipsCount - 1


With Tips a variable of type string with a check in array, and TipsCount and TempInteger of type integer.
 

ZelNaga

New Member
Reaction score
5
Mmhmm. This was the last thing I had to do, and now my maps done...just gotta protect it and start public beta testing. ^_^
 

Zaraf

New Member
Reaction score
22
Event:
- Map init
Conditions:
Actions:
- Set Tips[1] = This ...
- Set Tips[2] = That ...
- Set Tips[3] = Something ...
- Set Tips[4] = Whatever ...
- Set TipsCount = 4

Event:
- Time - Every 20.0 seconds
Conditions:
- TipsCount greater than 0
Actions:
- Set TempInteger = Random integer between 1 and TipsCount
- Game - Display to (All players) the text: Tips[TempInteger]
- Set Tips[TempInteger] = Tips[TipsCount]
- Set TipsCount = TipsCount - 1


With Tips a variable of type string with a check in array, and TipsCount and TempInteger of type integer.

Couldn't this prevent certain tips from being displayed, and display others multiple times?

For example, first time it displays Tip 2, the count is now down to 3, so there is no chance for it to display Tip 4 anymore, but it could display Tip 2 again.
 

velnias

New Member
Reaction score
13
to zaraf

actualy u wrong becouse u missed this line

Code:
Set Tips[TempInteger] = Tips[TipsCount]

it change just used tip into last tip and after all remove last tip
 

ZelNaga

New Member
Reaction score
5
Mmhmm Velnias is right. At first I thought it would do the same thing till I got to that line and then a lightbulb went on. :D:D:D
 

Zaraf

New Member
Reaction score
22
to zaraf

actualy u wrong becouse u missed this line

Code:
Set Tips[TempInteger] = Tips[TipsCount]

it change just used tip into last tip and after all remove last tip

Ahh, I missed that line. It effectively removes the just displayed tip from the list, and replaces it with the last tip in the list. Therefore, reducing the count doesn't matter anymore.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top