• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A LocalFiles Checker (No Save, just Load)

Status
Not open for further replies.
Level 1
Joined
Jan 12, 2021
Messages
2
Hello you wonderful people!

So I have a map that I have been working on for a while (stopped after Reforged released) and have started working on it again about a month ago.

Thankfully, most of everything I have so far implemented were do-able through the GUI of the world editor and other more complicated things I have been able to find in the HiveWorkshop forums/resources. (Thank you almighty gods of coding/modelmaking, I have added your names in the Credits Questlog in the F9 menu.)

Until I ran into this "issue."

I have made a trigger that basically checks the names of everyone that are ingame and recognizes the map creator and map designer.

  • CreatorCheck
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PlayerNames[(Player number of (Picked player))] = (Name of (Picked player))
      • Player - Set name of Player 1 (Red) to PlayerNames[(Player number of Player 1 (Red))]
      • Player - Set name of Player 2 (Blue) to PlayerNames[(Player number of Player 2 (Blue))]
      • Player - Set name of Player 3 (Teal) to PlayerNames[(Player number of Player 3 (Teal))]
      • Player - Set name of Player 4 (Purple) to PlayerNames[(Player number of Player 4 (Purple))]
      • Player - Set name of Player 5 (Yellow) to PlayerNames[(Player number of Player 5 (Yellow))]
      • Player - Set name of Player 6 (Orange) to PlayerNames[(Player number of Player 6 (Orange))]
      • Player - Set name of Player 7 (Green) to PlayerNames[(Player number of Player 7 (Green))]
      • Player - Set name of Player 8 (Pink) to PlayerNames[(Player number of Player 8 (Pink))]
      • Player - Set name of Player 9 (Gray) to PlayerNames[(Player number of Player 9 (Gray))]
      • Player - Set name of Player 10 (Light Blue) to PlayerNames[(Player number of Player 10 (Light Blue))]
      • Player - Set name of Player 12 (Brown) to PlayerNames[(Player number of Player 12 (Brown))]
      • Player - Set name of Player 13 (Maroon) to PlayerNames[(Player number of Player 13 (Maroon))]
      • Player - Set name of Player 14 (Navy) to PlayerNames[(Player number of Player 14 (Navy))]
      • Player - Set name of Player 15 (Turquoise) to PlayerNames[(Player number of Player 15 (Turquoise))]
      • Player - Set name of Player 16 (Violet) to PlayerNames[(Player number of Player 16 (Violet))]
      • Player - Set name of Player 17 (Wheat) to PlayerNames[(Player number of Player 17 (Wheat))]
      • Player - Set name of Player 18 (Peach) to PlayerNames[(Player number of Player 18 (Peach))]
      • Player - Set name of Player 19 (Mint) to PlayerNames[(Player number of Player 19 (Mint))]
      • Player - Set name of Player 20 (Lavender) to PlayerNames[(Player number of Player 20 (Lavender))]
      • Player - Set name of Player 21 (Coal) to PlayerNames[(Player number of Player 21 (Coal))]
      • Player - Set name of Player 22 (Snow) to PlayerNames[(Player number of Player 22 (Snow))]
      • Player - Set name of Player 23 (Emerald) to PlayerNames[(Player number of Player 23 (Emerald))]
      • Player - Set name of Player 24 (Peanut) to PlayerNames[(Player number of Player 24 (Peanut))]
      • Trigger - Turn on CreatorSet <gen>
      • Trigger - Turn on MMakerSet <gen>
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
This is CreatorSet inside of the trigger above:

  • CreatorSet
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Name of (Picked player)) Equal to CreatorN
            • Then - Actions
              • Set VariableSet Creator = (Player group((Picked player)))
              • Set VariableSet CreatorP = (Picked player)
              • Player - Set name of CreatorP to |cffffc100The Creat...
              • Player Group - Pick every player in Creator and do (Visibility - Create an initially Enabled visibility modifier for CreatorP emitting Visibility across (Entire map))
              • Game - Display to (All players) the text: |cffffc100THE CREAT...
              • Player - Hide CreatorP in the post-game score screen
              • Custom script: call DestroyTrigger(GetTriggeringTrigger())
            • Else - Actions
MMakerSet is basically the same trigger.

What this essentially does is Print a message saying "THE CREATOR IS IN THE GAME" when the creator is found and sets a player-group variable and a player variable to the picked player for a player kick system (theres a vote-kick already implemented, but if you are set as a creator or map designer then you can just kick whoever owns a unit you have selected ingame.)

Now the variable that I have for storing the name is a String Variable called CreatorN, its contains Username#xxxx.

But even if I protect the map, it would be easy to just open the map in a 3rd party editor and just change the value of that variable to whatever you want, allowing anyone that wanted to set their name as CreatorN or MMakerN and have it trigger for them.

So I have looked for a redundancy to combat this, and I have looked at the Codeless Save/Load created by TriggerHappy.

This system is perfect for what I am looking for, but only the Load portion of it, and instead of creating and editing a hero ingame, it would load a unique key file that the map designer and I would have (still checks the name though.)

I have tried to make it work myself, but I literally have no idea what I am doing. All the code in TriggerHappy's file I can't even comprehend and I have no idea how to make it work.

So, I am hoping that someone that knows JASS/vJASS could help me out and write a script that would check local files for a key? All it would do is make an integer variable go from 0 to 1 and disable a trigger that would keep that integer at 0, unless if theres a better method that I havent thought of. I'll be eternally grateful and will add your name to the Credits!

Please and thank you!

*Extra Request*
This request is not important, but is there a way to change the Game Interface "No Upkeep" message in the top right through a custom script ingame? I currently have it set to "By:Username" and it would be neat to have it change when the creator and/or map designer is ingame.
 
Level 1
Joined
Jan 12, 2021
Messages
2
My apologies, the solution that I have for this doesn't involve the LocalFiles function, it just takes multiple string variables with values already set with the username mixed into them and just meshes them together in a trigger that runs at initialization.

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet CreatorN = (a + (c + (e + (e + (i + (l + (n + (p + (s + (u + (v + (v + (w + (k + r))))))))))))))
and then an "authenticator" trigger with another set of mixed strings just checks if it matches.

Its a little embarrassing to have this be my solution, and the only JASS that I know is how to plug leaks and clean ITE's after I am done with the GUI portion. Currently studying the API and trying to better myself with understanding what I am looking at.
 
Status
Not open for further replies.
Top