Playing video in minimap

Status
Not open for further replies.
After some playing around with the change minimap functions I thought that playing a video in the minimap is a useless, yet awesome thing to do :p

So I was thinking how to do it as easily as possible. This is what I am trying to do, but it doesn't work and I have no idea why...

  • Set Paths
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Set ImagePath[1] = "war3mapImported\\1.blp"
      • Set ImagePath[2] = "war3mapImported\\2.blp"
      • Set ImgCounter = 0
      • Trigger - Turn on Change Image <gen>
  • Change Image
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set ImgCounter = (ImgCounter + 1)
      • Custom script: call BlzChangeMinimapTerrainTex(udg_ImagePath[udg_ImgCounter])

I CAN just do;
  • Custom script: call BlzChangeMinimapTerrainTex("war3mapImported\\1.blp")
  • Wait 0.00 seconds
  • Custom script: call BlzChangeMinimapTerrainTex("war3mapImported\\2.blp")
  • Wait 0.00 seconds
  • Custom script: call BlzChangeMinimapTerrainTex("war3mapImported\\3.blp")
But I would really just prefer a way to do it with strings and increasing integers. As you can see below using timed waits is kinda laggy/slow as the frames aren't played fast enough.

 

Attachments

  • MiniMap Video.w3x
    2.1 MB · Views: 57
Last edited:
Level 12
Joined
Feb 22, 2010
Messages
1,115
If I remember correctly, If you are using a path string in custom script DIRECTLY, you use double backslash. That is why your second example works. But if you use it indirectly from a GUI variable, GUI -> Jass conversion already handles this issue so you need to use a single backslash (editor adds another).
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,010
Lmao man, that video is awesome, yet pathetic at same time xD
You're doing it wrong, you only make "" and double \ in JASS, not GUI.
  • Solution
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ImagePath[1] = war3mapImported\1.blp
      • Set ImagePath[2] = war3mapImported\2.blp
      • Set ImagePath[3] = war3mapImported\3.blp
      • Set ImagePath[4] = war3mapImported\4.blp
      • Set ImagePath[5] = war3mapImported\5.blp
      • Set ImagePath[6] = war3mapImported\6.blp
      • Set ImagePath[7] = war3mapImported\7.blp
      • Set ImagePath[8] = war3mapImported\8.blp
      • Set ImagePath[9] = war3mapImported\9.blp
      • Set ImagePath[10] = war3mapImported\10.blp
      • Set ImagePath[11] = war3mapImported\11.blp
      • Set ImagePath[12] = war3mapImported\12.blp
      • -------- and so on... --------
      • Wait 2.00 seconds
      • Trigger - Turn on Loop <gen>
And this copy paste drives me to insanity, so we can praise ourselves with this little miracle right below, and so Jesus was born!
  • Best Solution
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local integer i = 1
      • Set MaxImageCounter = 62
      • Custom script: loop
      • Custom script: exitwhen i > udg_MaxImageCounter
      • Custom script: set udg_ImagePath[i] = "war3mapImported\\" + I2S(i) + ".blp"
      • Custom script: set i = i + 1
      • Custom script: endloop
      • Wait 2.00 seconds
      • Trigger - Turn on Loop <gen>
Absolute magic.
 

Attachments

  • MiniMap VideoFix.w3x
    2.1 MB · Views: 50
Lmao man, that video is awesome, yet pathetic at same time xD
You're doing it wrong, you only make "" and double \ in JASS, not GUI.
  • Solution
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ImagePath[1] = war3mapImported\1.blp
      • Set ImagePath[2] = war3mapImported\2.blp
      • Set ImagePath[3] = war3mapImported\3.blp
      • Set ImagePath[4] = war3mapImported\4.blp
      • Set ImagePath[5] = war3mapImported\5.blp
      • Set ImagePath[6] = war3mapImported\6.blp
      • Set ImagePath[7] = war3mapImported\7.blp
      • Set ImagePath[8] = war3mapImported\8.blp
      • Set ImagePath[9] = war3mapImported\9.blp
      • Set ImagePath[10] = war3mapImported\10.blp
      • Set ImagePath[11] = war3mapImported\11.blp
      • Set ImagePath[12] = war3mapImported\12.blp
      • -------- and so on... --------
      • Wait 2.00 seconds
      • Trigger - Turn on Loop <gen>
And this copy paste drives me to insanity, so we can praise ourselves with this little miracle right below, and so Jesus was born!
  • Best Solution
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local integer i = 1
      • Set MaxImageCounter = 62
      • Custom script: loop
      • Custom script: exitwhen i > udg_MaxImageCounter
      • Custom script: set udg_ImagePath[i] = "war3mapImported\\" + I2S(i) + ".blp"
      • Custom script: set i = i + 1
      • Custom script: endloop
      • Wait 2.00 seconds
      • Trigger - Turn on Loop <gen>
Absolute magic.
Awesome! Too bad the editor doesn't handle changing minimap images as fast as the framerate of the original gif. I am sure it will work pretty well with low FPS gifs though :p

Imagine telling a visual story in the minimap while playing. Imagine the amount of imported images one would need :D

I get a headache just thinking about it. Resizing the gif to 256x256, splitting it up into frames, converting every single image to blp files, importing them and making strings for them.... Would be fun to see the result though.
 
Why not use a timer or periodic event to do this? Add a test after incrementing the integer to check that it has reached the sequence length. If at the sequence length, set it back to 0.
That was my initial approach but I failed at the string variables. I haven't tested what @Ceday suggested yet as @Wrda already posted a working example.
 
It's faster if you create a backdrop on top of minimap and change its texture.
Note: some of the imported files are missing that's why you will see some green textures.
That's hilarious!

The textures aren't missing, it's just that I messed up the imports so image no. 20 is actually no. 18, so to do it properly without any green ones you would need to skip no. 18 and 19 and jump straight from 17 to 20.
 
Status
Not open for further replies.
Top