• 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.

A trackable question

Status
Not open for further replies.
How would one go about creating trackables to cover the entire map?

I don't know the equation and I have been trying to figure it out, also does anyone have a 16x16 or 32x32 blank model? I think maybe 64x64 would be better for less lag.... It's been a while since I messed with this so I would appreciate all the help anyone could give me.

Thanks for reading.
 
Trackables are hard to manage in the native implementation of WC3, so I highly recommend you use a system like this:

http://www.hiveworkshop.com/forums/jass-resources-412/system-track-205760/

It has a great and simple API that allows to get the player that fired the trackable event and the trackable that fired it.

That should basicly do the trick. Just do a double nested loop (columns and rows) for the creation of the trackable grid.
 
Thanks for the quick reply however I am a GUI'er though if I can locate the equation and math used then I should be able to figure it out. Thanks again, I will post an edit if I stumble upon difficulties.

Though trackables aren't hard to use/implement however they aren't complete either.

EDIT: Anyone willing to translate the math here into a GUI-like example?

[jass=]
private function CreateTracks takes nothing returns nothing
local rect r = bj_mapInitialPlayableArea
local real xMax = GetRectMaxX(r)
local real xMin = GetRectMinX(r)
local real yMax = GetRectMaxY(r)
local real yMin = GetRectMinY(r)

local real xOff = xMin
local real yOff = yMin

set centerX = GetRectCenterX(r)
set centerY = GetRectCenterY(r)

call SetCameraPosition(centerX, centerY)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK,270,0)
call FogMaskEnable(false)
call FogEnable(false)
call BJDebugMsg("Generation has begun...")
//! textmacro LoopGen takes SIZE
loop
exitwhen xOff >= xMax
loop
exitwhen yOff >= yMax
set Tracks[size] = Track.create(MODEL_$SIZE$, xOff, yOff, 0, 0)
set size = size + 1
set yOff = yOff + RADIUS_$SIZE$
endloop
set yOff = yMin
set xOff = xOff + RADIUS_$SIZE$
endloop
//! endtextmacro
[/code]
 
I only need the math for the creation of the trackable grid, everything else is already complete. Thanks though. Only need a GUI example of the stuff required to make the grid.

I can't use newgen on my current computer because I am too lazy to keep moving files back and fourth to fight with mcafee.
Yeah I understand it easily Zwiebelchen, it is just I would rather not use VJass. I am one of the rare almost mythical intelligent GUI'ers who is capable of all the languages/versions of JASS. =P

Biggest problem here is... It takes time to transfer this to a GUI method and I usually mess up about 5-8 times before I actually get it right so I figured I should just ask for the efficient way of making the grid if possible.
 
It's as simple as that (written in pseudo code because I don't know GUI):
Code:
Set TileSize = 64
Set MinX = whatever
Set MinY = whatever
Set MaxX = whatever
Set MaxY = whatever
For Each Integer A from MinX/Tilesize To MaxX/Tilesize Do:
     Set Integer B = 0
     For Each Integer B from MinY/Tilesize To MaxY/Tilesize Do:
           Create Trackable at X: Integer A*Tilesize + Tilesize/2; at Y: Integer B*Tilesize + Tilesize/2
           Set Integer B = B + 1
     Set Integer A = A + 1

The min and max values are the corner points of your rectangle you want to fill with trackables.
The tilesize is the edge size of your trackable model. 64 is the size of a 2x2 pathing blocker.
 
Only thing I don't get is TileSize, I thought the size of the trackable depended on the model used?
Yeah but the game does not know how big the model is. You need to know that for a perfect grid.
Also remember to create the trackables at the right coordinates:

x = Integer A * Tilesize + Tilesize/2
y = Integer B * Tilesize + Tilesize/2

the "+Tilesize/2" is required because you want the trackable at the center of each "block", not at the corner points.
 
I still don't understand how to do this without a model made exactly for this purpose.

Does it just auto-detect tilesize?

In my test map I use the invisible platforms (as Zwieb said). For your convenience, the paths are here:
JASS:
"Doodads\\Terrain\\InvisiblePlatformSmall\\InvisiblePlatformSmall.mdl"
"Doodads\\Terrain\\InvisiblePlatform\\InvisiblePlatform.mdl"

The first one is smaller than the second.

The small platform should cover a distance of about 73.58, and the larger one should cover a distance of about 147.18 (assuming wc3 units count for the same distance as the distances between vertices in models).

EDIT: Do you use Jass NewGen Pack? If so, I can make you an example using GUI. It is kinda difficult to do trackables in GUI without some underlying system.
 
Okay so I gave it another go and I got a bit further then last time, would appreciate it if either you purge or Zwiebelchen would take a look at the testmap and see what I am doing wrong. By the way purge, why would I need newgen? Sadly I can't use it, just was curious.

Btw if I ever get this working thanks to the help of you guys, I will definitely be making a tutorial and a system show-how for everyone who wants to use control of the mouse, but is clueless how to do so in GUI. Kind of wanted to make this for myself as well others who suffer the same problem. If this ever gets working then new maps might be made and new genre's invented. :thumbs_up:
 

Attachments

  • GUImousecontrol.w3x
    15.9 KB · Views: 47
Status
Not open for further replies.
Top