• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Simple Hint Generator GUI or JASS 0.8

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This is a samle that allows you to easily generate hints at a series or in a random order. When the hints have all been show it just repeats after a duration. You can easily change the constant wait betweem intervalls or hint repetition.
Another feature is that each player can turn off their hints which in turn will give them a hint once in awhile reminding them to turn it on.
You can turn everything of by setting hintOn == FALSE and turn it on agian by setting TRUE it will pick up where it ended.

Note: The sample map now contains both GUI and JASS.


You pick either the randomize version or the linear version. When you want to start them you simply do the following:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set hintsOn = TRUE
      • -------- Choose this... --------
      • Custom script: call ExecuteFunc("LinearHints")
      • -------- Or this... --------
      • Custom script: call ExecuteFunc("RandomizedHints")
JASS:
// How to use:
/*
You basically only change the constants in the global tags and add strings in the SetupHint function. 
Once everything is setup you chose which function you prefer to use either the "LinearHints function" 
or the "RandomizedHints function"
*/
// LinearHints work by just looping through every hint in the array and starting over.

// Randomized Hints work by picking a random hint each time and then removing it from the avalible pool until all hints
// have been played, then it restarts.

globals
    trigger trg_Hints
    boolean array hintsPlayerOn
    string array hint
    boolean hintsOn
    constant real HINT_DISPLAY_TIME = 15            // This is the Time which the messages are displayed.
    constant real HINT_RESTART_WAIT = 5             // This is the Wait Time befor the hint cycle restarts
    constant real HINT_INTEVAL_WAIT = 5             // This is the Wait Time between two hints, prior to a cycle finnish.
    constant real MIN_TIME_BEFOR_REMINDER = 15      // This is the Time befor a hint "enable" reminder is shown.
endglobals

function SetupHints takes nothing returns nothing       
    set hint[0] = "|cff32cd32Hint #1|r - Generic Hint Here!"   
    set hint[1] = "|cff32cd32Hint #2|r - Generic Hint Here!"
    set hint[2] = "|cff32cd32Hint #3|r - Generic Hint Here!"
    set hint[3] = "|cff32cd32Hint #4|r - Generic Hint Here!"
endfunction

function LinearHints takes nothing returns nothing
    local real array timeSinceLastHint
    local integer MAX = 0 
    local integer count 
    local integer i
    
    call SetupHints()
    call EnableTrigger(trg_Hints)
    set trg_Hints = null
    
    loop
      exitwhen hint[MAX + 1] == null
      set MAX = MAX + 1
      endloop
      
      set count = 0
    loop
        if hintsOn == TRUE then
            set i = 0 
            loop
            if hintsPlayerOn[i] == TRUE and GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                call DisplayTimedTextToPlayer( Player(i), 0, 0, HINT_DISPLAY_TIME, hint[count])
                elseif hintsPlayerOn[i] == FALSE and GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                    set timeSinceLastHint[i] = timeSinceLastHint[i] + HINT_INTEVAL_WAIT // Basically this counts the interval time, not accuretly,
                    if MIN_TIME_BEFOR_REMINDER < timeSinceLastHint[i] then              // but it fills its purpose in my oppinion. 
                        call DisplayTimedTextToPlayer( Player(i), 0, 0, HINT_DISPLAY_TIME, "|cff995500Notice|r - You can enable/disable hints by typing '|cffffcc00-hints on|r/|cffffcc00off|r'")
                        set timeSinceLastHint[i] = 0 
                    endif
            endif
            exitwhen i == 11
            set i = i + 1
            endloop
            
            set count = count + 1
            if count > MAX then
                set count = 0
                call TriggerSleepAction(HINT_RESTART_WAIT)
            endif
            call TriggerSleepAction(HINT_INTEVAL_WAIT)
        endif
      endloop
    
endfunction

function RandomizedHints takes nothing returns nothing
    local string array hint1
    local real array timeSinceLastHint
    local integer MAX = 0
    local integer random
    local string tempHint
    local integer count
    local integer i
    
    call SetupHints()
    call EnableTrigger(trg_Hints)
    set trg_Hints = null

      loop
      set hint1[MAX] = hint[MAX]
      exitwhen hint[MAX + 1] == null
      set MAX = MAX + 1
      endloop
      set count = MAX
      
      loop
        if hintsOn == TRUE then
            set random = GetRandomInt(0, count)
            set i = 0 
            
            loop
            if hintsPlayerOn[i] == TRUE and GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                call DisplayTimedTextToPlayer( Player(i), 0, 0, HINT_DISPLAY_TIME, hint1[random])
                elseif hintsPlayerOn[i] == FALSE and GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                    set timeSinceLastHint[i] = timeSinceLastHint[i] + HINT_INTEVAL_WAIT // Basically this counts the interval time, not accuretly,
                    if MIN_TIME_BEFOR_REMINDER < timeSinceLastHint[i] then              // but it fills its purpose in my oppinion. 
                        call DisplayTimedTextToPlayer( Player(i), 0, 0, HINT_DISPLAY_TIME, "|cff995500Notice|r - You can enable/disable hints by typing '|cffffcc00-hints on|r/|cffffcc00off|r'")
                        set timeSinceLastHint[i] = 0 
                    endif
            endif
            exitwhen i == 11
            set i = i + 1
            endloop
            
            set tempHint = hint1[random]
            set hint1[random] = hint1[count]
            set hint1[count] = tempHint
            set count = count - 1
            if count < 0 then
                set count = MAX
                call TriggerSleepAction(HINT_RESTART_WAIT)
            endif
            call TriggerSleepAction(HINT_INTEVAL_WAIT)
        endif
      endloop
endfunction


function HintCommands takes nothing returns nothing
local integer pID = GetPlayerId(GetTriggerPlayer())
local integer substring
    if GetEventPlayerChatString() == "-hints on" and hintsPlayerOn[pID] == FALSE then
        set hintsPlayerOn[pID] = TRUE
        call DisplayTimedTextToPlayer( Player(pID), 0, 0, HINT_DISPLAY_TIME, "|cff995500Hints Enabled|r")
    elseif GetEventPlayerChatString() == "-hints off" and hintsPlayerOn[pID] == TRUE then
        set hintsPlayerOn[pID] = FALSE
        call DisplayTimedTextToPlayer( Player(pID), 0, 0, HINT_DISPLAY_TIME, "|cff995500Hints Disabled|r")
        elseif GetEventPlayerChatStringMatched() == "-hint" then
        
        set substring = S2I(SubString(GetEventPlayerChatString(),6,7)) - 1
       // set substring = substring - 1
        if hint[substring] != null then
            call DisplayTimedTextToPlayer( Player(pID), 0, 0, HINT_DISPLAY_TIME, hint[substring])
        else 
            call DisplayTimedTextToPlayer( Player(pID), 0, 0, HINT_DISPLAY_TIME, "|cffff0000Error|r - No maching hint found.")
        endif
    endif
endfunction

function InitTrig_Hints takes nothing returns nothing
    set trg_Hints = CreateTrigger()
    call DisableTrigger(trg_Hints )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(0), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(1), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(2), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(3), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(4), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(5), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(6), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(7), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(8), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(9), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(10), "-hint", false )
    call TriggerRegisterPlayerChatEvent(trg_Hints, Player(11), "-hint", false )
    call TriggerAddAction(trg_Hints, function HintCommands )

endfunction

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- REMEBER TO ONLY HAVE ONE FUNCTION EXECUTION PER TEST... --------
      • -------- GUI VERSION --------
      • Trigger - Turn on HintsGUI <gen>
      • Set hintsOn = True
      • -------- Choise this... --------
      • Custom script: call ExecuteFunc("LinearHints")
      • -------- Or this... --------
      • Custom script: call ExecuteFunc("RandomizedHints")
      • -------- JASS VERSION --------
      • Custom script: set hintsOn = TRUE
      • -------- Choise this... --------
      • Custom script: call ExecuteFunc("LinearHints")
      • -------- Or this... --------
      • Custom script: call ExecuteFunc("RandomizedHints")

  • HintsGUI
    • Events
      • Player - Player 1 (Red) types a chat message containing -hint as A substring
      • Player - Player 2 (Blue) types a chat message containing -hint as A substring
      • Player - Player 3 (Teal) types a chat message containing -hint as A substring
      • Player - Player 4 (Purple) types a chat message containing -hint as A substring
      • Player - Player 5 (Yellow) types a chat message containing -hint as A substring
      • Player - Player 6 (Orange) types a chat message containing -hint as A substring
      • Player - Player 7 (Green) types a chat message containing -hint as A substring
      • Player - Player 8 (Pink) types a chat message containing -hint as A substring
      • Player - Player 9 (Gray) types a chat message containing -hint as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -hint as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -hint as A substring
      • Player - Player 12 (Brown) types a chat message containing -hint as A substring
    • Conditions
    • Actions
      • -------- THIS FIRST PART IS FOR HINT COMMANDS --------
      • Custom script: local integer substring
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -hints on
          • hintsOnForPlayer[(Player number of (Triggering player))] Equal to False
        • Then - Actions
          • Set hintsOnForPlayer[(Player number of (Triggering player))] = True
          • Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, udg_HINT_DISPLAY_TIME, "|cff995500Hints Enabled|r")
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to -hints off
              • hintsOnForPlayer[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • Set hintsOnForPlayer[(Player number of (Triggering player))] = False
              • Custom script: call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, udg_HINT_DISPLAY_TIME, "|cff995500Hints Disabled|r")
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Matched chat string) Equal to -hint
                • Then - Actions
                  • Custom script: set substring = S2I(SubString(GetEventPlayerChatString(),6,8)) - 1
                  • Custom script: if udg_HINT[substring] != null then
                  • Custom script: call DisplayTimedTextToPlayer( GetTriggerPlayer(), 0, 0, udg_HINT_DISPLAY_TIME, udg_HINT[substring])
                  • Custom script: else
                  • Custom script: call DisplayTimedTextToPlayer( GetTriggerPlayer(), 0, 0, udg_HINT_DISPLAY_TIME, "|cffff0000Error|r - No maching hint found.")
                  • Custom script: endif
                • Else - Actions
      • Custom script: endfunction
      • Custom script: function SetupHints takes nothing returns nothing
      • -------- Note that the first hint is reserved for reminding players how to turn on hint. --------
      • Set HINT[0] = |cff32cd32Hint #1|r - You can enable/disable hints by typing '|cffffcc00-hints on|r/|cffffcc00off|r'
      • -------- CUSTOMIZE YOUR SETTINGS BELOW --------
      • -------- You can add as many hints as you like --------
      • Set HINT[1] = |cff32cd32Hint #2|r - Generic Hint Here!
      • Set HINT[2] = |cff32cd32Hint #3|r - Generic Hint Here!
      • Set HINT[3] = |cff32cd32Hint #4|r - Generic Hint Here!
      • Set HINT[4] = |cff32cd32Hint #5|r - Generic Hint Here!
      • Set HINT[5] = |cff32cd32Hint #6|r - Generic Hint Here!
      • Set HINT[6] = |cff32cd32Hint #7|r - Generic Hint Here!
      • Set HINT_DISPLAY_TIME = 15.00
      • Set HINT_RESTART_WAIT = 5.00
      • Set HINT_INTERVAL_WAIT = 5.00
      • Set HINT_MIN_REMIND_TIME = 20.00
      • -------- --------
      • -------- DON'T CHANGE ANYTHING BELOW THIS! --------
      • -------- --------
      • -------- REMOVE EITHER OPTION 1 OR OPTION 2 I SUGGEST YOU TRY THEM BEFOR YOU CHOSE ONE --------
      • -------- --------
      • -------- OPTION 1 BEGINS HERE --------
      • Custom script: endfunction
      • Custom script: function LinearHints takes nothing returns nothing
      • Custom script: local real array timeSinceLastHint
      • Custom script: local integer MAX = 0
      • Custom script: local integer count = 1
      • Custom script: local integer i
      • Custom script: call SetupHints()
      • Custom script: loop
      • Custom script: exitwhen udg_HINT[MAX + 1] == null
      • Custom script: set MAX = MAX + 1
      • Custom script: endloop
      • -------- Start Looping into Infinity --------
      • Custom script: loop
      • Custom script: if count > MAX then
      • Custom script: set count = 1
      • Wait HINT_RESTART_WAIT seconds
      • -------- Wait here for restart time --------
      • Custom script: endif
      • -------- wait here for intervall time --------
      • Wait HINT_INTERVAL_WAIT seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • hintsOn Equal to True
        • Then - Actions
          • Custom script: set i = 1
          • Custom script: loop
          • Custom script: if udg_hintsOnForPlayer[i] == TRUE and GetPlayerController(Player(i-1)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i-1)) == PLAYER_SLOT_STATE_PLAYING then
          • Custom script: call DisplayTimedTextToPlayer( Player(i-1), 0, 0, udg_HINT_DISPLAY_TIME, udg_HINT[count])
          • Custom script: elseif udg_hintsOnForPlayer[i] == FALSE and GetPlayerController(Player(i-1)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i-1)) == PLAYER_SLOT_STATE_PLAYING then
          • Custom script: set timeSinceLastHint[i] = timeSinceLastHint[i] + udg_HINT_INTERVAL_WAIT
          • Custom script: if udg_HINT_MIN_REMIND_TIME < timeSinceLastHint[i] then
          • Custom script: call DisplayTimedTextToPlayer( Player(i-1), 0, 0, udg_HINT_DISPLAY_TIME, udg_HINT[0])
          • Custom script: set timeSinceLastHint[i] = 0
          • Custom script: endif
          • Custom script: endif
          • Custom script: exitwhen i == 12
          • Custom script: set i = i + 1
          • Custom script: endloop
          • Custom script: set count = count + 1
        • Else - Actions
      • Custom script: endloop
      • Custom script: endfunction
      • -------- OPTION 1 ENDS HERE --------
      • -------- --------
      • -------- OPTIONS 2 BEGINS HERE --------
      • Custom script: function RandomizedHints takes nothing returns nothing
      • Custom script: local string array hint1
      • Custom script: local real array timeSinceLastHint
      • Custom script: local integer MAX = 0
      • Custom script: local integer random
      • Custom script: local string tempHint
      • Custom script: local integer i
      • Custom script: local integer count
      • Custom script: call SetupHints()
      • Custom script: loop
      • Custom script: set hint1[MAX] = udg_HINT[MAX]
      • Custom script: exitwhen udg_HINT[MAX + 1] == null
      • Custom script: set MAX = MAX + 1
      • Custom script: endloop
      • Custom script: set count = MAX
      • -------- Start Looping into Infinity --------
      • Custom script: loop
      • Custom script: if count < 1 then
      • Custom script: set count = MAX
      • Wait HINT_RESTART_WAIT seconds
      • -------- Wait here for restart time --------
      • Custom script: endif
      • -------- wait here for intervall time --------
      • Wait HINT_INTERVAL_WAIT seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • hintsOn Equal to True
        • Then - Actions
          • Custom script: set random = GetRandomInt(1, count)
          • Custom script: set i = 1
          • Custom script: loop
          • Custom script: if udg_hintsOnForPlayer[i] == TRUE and GetPlayerController(Player(i-1)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i-1)) == PLAYER_SLOT_STATE_PLAYING then
          • Custom script: call DisplayTimedTextToPlayer( Player(i-1), 0, 0, udg_HINT_DISPLAY_TIME, hint1[random])
          • Custom script: elseif udg_hintsOnForPlayer[i] == FALSE and GetPlayerController(Player(i-1)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i-1)) == PLAYER_SLOT_STATE_PLAYING then
          • Custom script: set timeSinceLastHint[i] = timeSinceLastHint[i] + udg_HINT_INTERVAL_WAIT
          • Custom script: if udg_HINT_MIN_REMIND_TIME < timeSinceLastHint[i] then
          • Custom script: call DisplayTimedTextToPlayer( Player(i-1), 0, 0, udg_HINT_DISPLAY_TIME, udg_HINT[0])
          • Custom script: set timeSinceLastHint[i] = 0
          • Custom script: endif
          • Custom script: endif
          • Custom script: exitwhen i == 12
          • Custom script: set i = i + 1
          • Custom script: endloop
          • Custom script: set tempHint = hint1[random]
          • Custom script: set hint1[random] = hint1[count]
          • Custom script: set hint1[count] = tempHint
          • Custom script: set count = count - 1
        • Else - Actions
      • Custom script: endloop
      • -------- OPTION 2 ENDS HERE --------
      • -------- --------
Keywords:
Hint Hints Generator Random Randomized linear display make hints GUI gui simple easy
Contents

Hint Generator 0.9 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 02:57, 11th Feb 2013 Maker: Setting to pending as requested by the uploader.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

02:57, 11th Feb 2013
Maker: Setting to pending as requested by the uploader.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
A neat trick I learned from Maker, is that you don't need to allow the user to input their maximum/total object (in this case, it is 5 - for 5 hints).

You can do this on your own - making your system more user-friendly instead letting them to put their object's size.

  • Actions
    • Set String[1] = HELLO
    • Set String[2] = THERE
    • Set String[3] = HOW
    • Set String[4] = ARE
    • Set String[5] = YOU
    • Set TempInt = 1
    • For each (Integer LoopingInteger) from 1 to TempInt, do (Actions)
      • Loop - Actions
        • Custom script: if udg_String[udg_LoopingInteger] == null then
        • Set ObjectSize = (LoopingInteger - 1)
        • Custom script: else
        • Set TempInt = (TempInt + 1)
        • Custom script: endif
    • Game - Display to (All players) the text: (String(ObjectSize))
By doing this way, it is more user-friendly :)

The idea is that, you loop until the element becomes null (never gets registered).
Then, the null index is the size of the object.

This is applied to HINT_MAX in case you're confused.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
:ogre_frown: :wink: :eekani: Why you using wait action ? ...... ?

How precise does it need to be? :eek:

Updated 1:
- Moved the setup to initialization.
- Added defskulls feature, or Makers? ;P
- Only displays messages to active playing, user, enabled players.

Considering:
- Moving everything to one trigger, but that might complicate for the targeted user even futher. :> (added for jassversion)
- Prevent the random hint from generating the last random genereted hint when it starts over.
- Adding a reminder displaying how to turn on hints if you havent every once in awhile. (added for jass version)
- Forgot to remove unused variables...

Also if anyone has any ideas how to keep other messages but only allow one hint message at a time you might advice me! Would like to have some thing similar for customized error-messages aswell.

Update 2: Made a jass version!
Update 3: The jass version now inclouds the command "-hint XX" and this will let you retrive the hint associated with that number. This gave me the idea that you type "-hint" and then go on from there "-next" but meh, leaving it at this for now.
 
Last edited:
Level 15
Joined
Nov 30, 2007
Messages
1,202
Well, it displays a hint that isn't associated to any particular event, thats why I felt no need for them to be accurate. But if you really think it is needed I'll look into it. If you really want to see something unaccurate, look at the "reminder part" XD

*Edit I'm not sure exactly how to work with timers havn't done that befor tbh, perhaps you could give a example on this matter...?

I Guess a periodic 1s trigger with a varaible turning on when its time but... meh...

Update v.0.9: The Gui version has the same features as the jass version. The jass version is now present in the test map and can be enabled for people with jassnewgenpack. Everything is now moved to one trigger. Hopefully this doesnt complicate things for the user.

Noticed I messed up the randomizer with the last update.
Seems like I misspelled matching ;p
I will reallow the first hint to be displayed along with the others and not just when hints are turned off.
Custom script: if udg_HINT_MIN_REMIND_TIME < timeSinceLastHint[i this line is missing a condition checking for active players.
 
Last edited:
The indentation is messed up.

edit
Also, since this is vJASS, you should probably use a vJASS initializer and wrap the vJASS code up inside a library.

(It's vJASS because you're using globals blocks and /* */ comments)

edit
Don't use TRUE and FALSE, use true and false.
The difference is that TRUE/FALSE are variables while true/false are direct values.

edit
The input strings should be configurable from the globals block.
(Same for the error strings and everything that can be changed by the user.)

edit
== TRUE and == true are the most redundant things ever.
You can remove them and nothing would happen.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
The indentation is messed up.

edit
Also, since this is vJASS, you should probably use a vJASS initializer and wrap the vJASS code up inside a library.

(It's vJASS because you're using globals blocks and /* */ comments)

Can't do those things my installation isnt allowing me to use those codes, and I havn't got around to reinstalling it.

Which one, the gui one or the jass one... both? :p

edit
Don't use TRUE and FALSE, use true and false.
The difference is that TRUE/FALSE are variables while true/false are direct values.
Okey, thanks for information.

edit
The input strings should be configurable from the globals block.
(Same for the error strings and everything that can be changed by the user.)
Hmm you sure about this? I mean it's in quotation marks, it should be straight forward. Could add a comment to make the user notice them? or I could add them in
Hint[0] is the reminder.
Hint[1] is the error message.
Hint[2] Enabled
Hint[3] disabled

Do you think that the gui version should be using normal DisplayPlayerGroup action instead of custom script so they can more easily understand what is going on? Or just add more documentation?

or as constants in the global tags but I dont find this to be needed? But if you insist upon it again I will change it. :p
edit
== TRUE and == true are the most redundant things ever.
You can remove them and nothing would happen.
Haha, I use them allways, didnt know this, thank you :p


Will you be making any more major updates for this resource?
I'll remind you if I do. ;)

Okey this is what I'm gonna add:
- randomizeOn boolean (Will merge the two options.)
- hideHint[] boolean => true hides it the next run and false puts it back in.
- If someone show me how to use timers I would use that instead of waits, oh well.
- gonna remove the TRUE/FALSE thing.
- gonna add a missing condition related to none-playing players.
- Should I add a boolean to enable/disable -hint commands and enable/disable "-hint xx" comand? or just instruct on how to remove it?
 
Last edited:
Hmm you sure about this? I mean it's in quotation marks, it should be straight forward. Could add a comment to make the user notice them? or I could add them in
Hint[0] is the reminder.
Hint[1] is the error message.
Hint[2] Enabled
Hint[3] disabled

Do you think that the gui version should be using normal DisplayPlayerGroup action instead of custom script so they can more easily understand what is going on? Or just add more documentation?

or as constants in the global tags but I dont find this to be needed? But if you insist upon it again I will change it. :p

It's always better to keep the user away from your code and limit him to modifying only a specific part of it (In this case, the globals)

The hint string array should only be for hints.

What I was referring to is something along the lines of this:

JASS:
globals
    // A player must type this in order to enable hints.
    private constant string COMMAND_ON = "-hints on"
    // A player must type this in order to disable hints.
    private constant string COMMAND_OFF = "-hints off"
    // A player must type this followed by a number separated by a space 
    // in order to have a certain hint displayed.
    private constant string COMMAND_GET_HINT = "-hint"
    // This string is displayed sometimes to remind the player that 
    // he can disable/enable hints.
    private constant string ENABLE_DISABLE_REMINDER = "|cff995500Notice|r - You can enable/disable hints by typing '|cffffcc00-hints on|r/|cffffcc00off|r'"
    // This will be displayed if no valid hint is found when a player 
    // types -hint ##
    private constant string INVALID_HINT = "|cffff0000Error|r - No maching hint found."
    // etc....
endglobals
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
It's always better to keep the user away from your code and limit him to modifying only a specific part of it (In this case, the globals)

The hint string array should only be for hints.

What I was referring to is something along the lines of this:

JASS:
globals
    // A player must type this in order to enable hints.
    private constant string COMMAND_ON = "-hints on"
    // A player must type this in order to disable hints.
    private constant string COMMAND_OFF = "-hints off"
    // A player must type this followed by a number separated by a space 
    // in order to have a certain hint displayed.
    private constant string COMMAND_GET_HINT = "-hint"
    // This string is displayed sometimes to remind the player that 
    // he can disable/enable hints.
    private constant string ENABLE_DISABLE_REMINDER = "|cff995500Notice|r - You can enable/disable hints by typing '|cffffcc00-hints on|r/|cffffcc00off|r'"
    // This will be displayed if no valid hint is found when a player 
    // types -hint ##
    private constant string INVALID_HINT = "|cffff0000Error|r - No maching hint found."
    // etc....
endglobals

Got it, will add it.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
declaring globalsmakes the system not JASS but vJASS
This would be better if this includes game hints,hero(unit) hints,items hints,etc


You mean I attach hints to a specific object?
hintId[Object] ="PALADIN"
hintListStart[Object]
hintListEnd[Object]
HintList[Just shuffle them after the start end of previous object]

Set currentHint[playerId] = "PALADIN"


JASS:
string array hintId
string array hintList
string array hintListEnd
string array hintListStart
string array currentHintId // Curret Hint Displayed for ( player Id )

set hintId[000] = "PALADIN"
set hintId[001] = "BLADEMASTER"
//...


set HintList[i] = "000 You have selected the Paladin, he is both a warrior and a healer, use your..."
set i = i + 1
set HintList[i] = "000 Your Holy light can also be used to damage enemy undead..."
set i = i + 1
set HintList[i] = "000 It can sometimes be useful to skill the aura..."
set i = i + 1
set HintList[i] = "001 The quickest way to dispatch enemies is through bladestorm..."
//...
/*After this i just loop through the different hints and identify their type 000 and 001 in this case link it to a start and end number.
And when I want to use i do this example: set currentHintId[GetPlayerId(GetTriggerPlayer())] = PALADIN     Thi would display hints from hintListStart[000] to hintLitEnd[000]*/

local integer previousId = -1
local integer currentId = 0
set i = 0
	loop
		set currentId = I2S(Substring(1,3, hintList[i])
			if currentId > previousId then
			set hintlistStart[currentId] = i
			set previusId = previousId + 1
				if currentId > 0 then
				set hintListEnd[currentId-1] = i - 1
				endif
			endif
	set i = i + 1
	exitwhen hintList[i] == null
	endloop


What you think?
 
Last edited:
Top