• 🏆 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!

[General] in-game grid view

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
Okay so I need to have a grid inside the game for debugging purposes.
What are your thoughts on this and how would I go about creating it?

I might have an idea but I want to hear your opinion on how you would do it.

Personally I'm thinking about projecting a "line" blp file on the exact grid through code. Or would it be better to project an actual grid image on top of the terrain?

Tell me how you would do it :)
 
Do a 120*120 image with white borders or a 600*600 image with white borders for every 120*120 squares and yellow borders for the big 600*600 one.

Now, if you have (just an example) 32*64 map size, you put 32 120*120 squares (or 7 if 600*600 squares) side by side.
You now need to copy that line and put it down 64 times (13 times only if 600*600 squares)

Save the final pcture, convert it in blp. Import it in the map and create an ubersplat using the imported picture at the center of the map. Now you have a grid like the editor's one in game.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Do a 120*120 image with white borders or a 600*600 image with white borders for every 120*120 squares and yellow borders for the big 600*600 one.

Now, if you have (just an example) 32*64 map size, you put 32 120*120 squares (or 7 if 600*600 squares) side by side.
You now need to copy that line and put it down 64 times (13 times only if 600*600 squares)

Save the final pcture, convert it in blp. Import it in the map and create an ubersplat using the imported picture at the center of the map. Now you have a grid like the editor's one in game.

hmm I figured that would be a good idea,
The dimensions need to be 512x512 for all the white lines + yellow ones with alpha as it's easyer to create one image instead of each 32x32, 64x64 and 512x512 individually.

I think it's better to put it in there with CreateImage() then using an ubersplat though. Why would an ubersplat be more sufficient?
An algorithm to duplicate the 512x512 image over the entire grid would be a good idea IMO.

Thanks for your input +rep

I surely hope there is someone who has a pure code approach to this, it might be more efficient (✌゚∀゚)☞
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Welll... it's a "lightning" grid; the lines may look a bit large, but the grid will work correctly.

Try this. It creates tons of leaks but works for testing purposes :)

JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    local real minX = GetRectMinX(bj_mapInitialPlayableArea)
    local real maxX = GetRectMaxX(bj_mapInitialPlayableArea)
    local real minY = GetRectMinY(bj_mapInitialPlayableArea)
    local real maxY = GetRectMaxY(bj_mapInitialPlayableArea)
    local real x = minX
    local real y = minY
    local real grid = 256
    //local string Light = "DRAB" // Uncomment to activate this lightning effect
    //local string Light = "DRAL" // Uncomment to activate this lightning effect
    //local string Light = "DRAM" // Uncomment to activate this lightning effect
    //local string Light = "LEAS" // Uncomment to activate this lightning effect
    //local string Light = "HWPB" // Uncomment to activate this lightning effect
    local string Light = "HWSB" 
    
    
    // X Lightnings
    loop
        exitwhen x > maxX
        call AddLightning (Light, false, x, minY, x, maxY)
        set x = x+grid
    endloop
    
    loop
        exitwhen y > maxY
        call AddLightning (Light, false, minX, y, maxX, y)
        set y = y+grid
    endloop

endfunction
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Thanks bro, for testing purposes it is a good idea to use this, but in near future it might be nice to have the actual wc3 grid on top of the terrain when typing -grid.
I'll create it sooner or later, but for now I'll use your code (•‿•)

+rep
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
MAYBE if you find a way to replace the Lightning models with a new one making it only a line with no animation you could make it look exactly like Wc3 grid
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
MAYBE if you find a way to replace the Lightning models with a new one making it only a line with no animation you could make it look exactly like Wc3 grid

As I said, I don't think changing the SLK file will do any good in terms of visual improvement. Take a look here:
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=73625

Ofcourse you can make it look "nicer", but re-creating the actual grid... I don't think it's possible through lightning.
Haven't really tested creating my own lightning model and putting it inside the SLK but I'm not sure if it'll work. I might ofcourse be totally wrong, I'm only human.
But I don't really want to waste my time creating a lightning model if it might not succeed
 
Last edited:
Status
Not open for further replies.
Top