• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

GUI - GS command

Status
Not open for further replies.
Level 10
Joined
Nov 24, 2010
Messages
546
oh ye just was playing for long and i forgot to say gs = gearscore.
Well it is value that show players quality of Gear.
Lets say some items has low quality, so they also provides low gearscore, and items with better quality provides higher gearscore.

so each item has it own value
item A has 30 gs
item B has 40 gs
item C has 40 gs

and if player have equiped all 3 items, and type -gs it will show massage: Player has got 120 Gear Score. something like that
 
I have included some documentation, it will hopefully guide you through.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- We initiate the hashtable --------
      • Custom script: set udg_Hash = InitHashtable()
      • -------- We will start, by saving the gearscore values on each item-type --------
      • -------- First item type has 20 Gear Score --------
      • Set Counter = (Counter + 1)
      • Set GearScoreList[Counter] = 20
      • -------- This is the first item's raw id: Ctrl + D to display object editor material in raw id form --------
      • Custom script: set udg_GearScoreItems[udg_Counter] = 'I000'
      • Hashtable - Save GearScoreList[Counter] as 0 of GearScoreItems[Counter] in Hash
      • -------- Second item type has 30 Gear Score --------
      • Set Counter = (Counter + 1)
      • Set GearScoreList[Counter] = 30
      • Custom script: set udg_GearScoreItems[udg_Counter] = 'I001'
      • Hashtable - Save GearScoreList[Counter] as 0 of GearScoreItems[Counter] in Hash
      • -------- Third item type has 15 Gear Score --------
      • Set Counter = (Counter + 1)
      • Set GearScoreList[Counter] = 15
      • Custom script: set udg_GearScoreItems[udg_Counter] = 'I002'
      • Hashtable - Save GearScoreList[Counter] as 0 of GearScoreItems[Counter] in Hash
      • -------- And so on... --------
      • -------- We will now initiate the command to be functional for every player --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Trigger - Add to Command <gen> the event (Player - Player 1 (Red) types a chat message containing -gs as An exact match)
            • Else - Actions
  • Command
    • Events
    • Conditions
    • Actions
      • Custom script: local integer score = 0
      • -------- Check what slots contain what items --------
      • For each (Integer CustomInt) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Item = (Item carried by Hero[(Player number of (Triggering player))] in slot CustomInt)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Item Not equal to No item
            • Then - Actions
              • Custom script: set udg_LoadGearScore = LoadInteger (udg_Hash, GetItemTypeId(udg_Item), 0)
              • Custom script: set score = score + udg_LoadGearScore
            • Else - Actions
      • -------- Display the message --------
      • Custom script: call DisplayTimedTextToPlayer (GetTriggerPlayer(), 0, 0, 3, "Your character has " + I2S(score) + " gear score.")
 

Attachments

  • Gear Score sample.w3x
    18.9 KB · Views: 47
Level 10
Joined
Nov 24, 2010
Messages
546
Okay pretty fine, but there is no other ways only IDs :( :(?
also massage is visible for each player. and it is "Players name" has X gearscore".
If there are no IDs i would be happy since im saving over 100 items.
also it work fine.
but one more thing, do it work for each player?
 
• If you want one command to be displayed to every player, I can see some abuses already.
• Yes, it works for every player.
• You are lucky, I have come up with another way. Just go to your item in the Object Editor, scroll to the field "Stats - Number of Charges" and set it to whatever gear score you wish that item to have.
Sample triggers & map:
  • Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Item = (Item being manipulated)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of Item) Not equal to Charged
        • Then - Actions
          • Custom script: if not HaveSavedInteger (udg_Hash, GetItemTypeId (udg_Item), 0) then
          • Set GearScore = (Charges remaining in Item)
          • Custom script: call SaveInteger (udg_Hash, GetItemTypeId (udg_Item), 0, udg_GearScore)
          • Custom script: endif
          • Item - Set charges remaining in Item to 0
        • Else - Actions
If your units can equip charged items and the gear score should take these items in consideration, then this trigger might need a few tweaks. Otherwise, it will work perfectly fine. ;]
 

Attachments

  • Gear Score sample (Alternative).w3x
    18.6 KB · Views: 31
Status
Not open for further replies.
Top