| 05-10-2008, 04:25 PM | #1 |
I tried using an model with no animations (Vex's dummy model from the caster system) but it doesn't work. Using a normal model works fine (like wisp). Any ideas of how to get an invisible model to work? Here's my code if your interested: JASS:scope Trackables globals //private constant string TRACKABLE_MODEL = "war3mapImported\\dummy.mdl" //A model with no animations (Thanks Vex) private constant string TRACKABLE_MODEL = "units\\nightelf\\Wisp\\Wisp.mdl" private constant integer ARRAY_SIZE = 143360 //256x256 map private real array x[ARRAY_SIZE] private real array y[ARRAY_SIZE] private gamecache gc endglobals private function H2I takes handle h returns integer return h return 0 endfunction private function Hit takes nothing returns nothing local integer i = GetStoredInteger(gc, "Trackables", I2S(H2I(GetTriggeringTrackable()))) debug call BJDebugMsg("Hit: " + R2S(x[i]) + "/" + R2S(y[i])) endfunction private function Over takes nothing returns nothing local integer i = GetStoredInteger(gc, "Trackables", I2S(H2I(GetTriggeringTrackable()))) debug call BJDebugMsg("Over: " + R2S(x[i]) + "/" + R2S(y[i])) endfunction private function Setup takes nothing returns nothing local trigger t1 = CreateTrigger() local trigger t2 = CreateTrigger() local trackable track local integer i1 = 0 //x local integer i2 = 0 //y local integer i3 = 0 //counter local rect gwb = GetWorldBounds() local real MinX = GetRectMinX(gwb) local real MaxX = GetRectMaxX(gwb) local real MinY = GetRectMinY(gwb) local real MaxY = GetRectMaxY(gwb) local integer width = R2I(MaxX - MinX) / 128 //in 128 blocks local integer height = R2I(MaxY - MinY) / 128 //^ debug call BJDebugMsg("Trackables - Starting") call RemoveRect(gwb) set gwb = null //call FlushGameCache(gc) set gc = InitGameCache("Trackables.w3v") loop loop set track = CreateTrackable(TRACKABLE_MODEL, MinX+(i1*128), MaxY-(i2*128), 0) call TriggerRegisterTrackableHitEvent(t1, track) call TriggerRegisterTrackableTrackEvent(t2, track) call StoreInteger(gc, "trackables", I2S(H2I(track)), i3) set x[i3] = MinX+(i1*128) set y[i3] = MaxY-(i2*128) set i3 = i3 + 1 set i1 = i1 + 1 //x debug call BJDebugMsg(I2S(i3)) exitwhen i1 == width endloop set i1 = 1 set i2 = i2 + 1 //y exitwhen i2 == height call TriggerSleepAction(.01) endloop call TriggerAddAction(t1, function Hit) call TriggerAddAction(t2, function Over) debug call BJDebugMsg("Trackables - Done") endfunction //Trackables need to be setup after the game starts, thus this. public function InitTrig takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterTimerEvent(t, .01, false) call TriggerAddAction(t, function Setup) endfunction endscope |
| 05-10-2008, 04:37 PM | #2 |
I think it's because the dummy model has no collision spheres; which is why it's not clickable. You would need a new/edited model with collision spheres for this purpose. |
| 05-10-2008, 04:46 PM | #3 |
I see. Are there still people in the "Artist's Discussion and Queries" forum doing requests? |
| 05-10-2008, 04:48 PM | #4 |
You can always ask, I'm sure someone will be willing :) |
| 05-10-2008, 08:51 PM | #5 |
You go Alex. Why don't you try the model that KaTTaNa used (www.wc3jass.com)? I think it works fine (and it's invisible), I see no reason not to use it. Well, actually I do see a reason, but, apparently, that problem only happens to me: for some reason they don't work, I did exactly like KaTTaNa said, but nooooooo..... why would something work for me...... If you ask me, trackables are haunted, use RtC instead (except if you have a good reason not to). |
| 05-10-2008, 10:58 PM | #6 |
KaTTaNa uses the peasent model if I'm not mistaken. I want a invisible one. |
| 05-10-2008, 11:31 PM | #7 | |
Quote:
|
| 05-10-2008, 11:53 PM | #8 |
Doodads\Terrain\InvisiblePlatform\InvisiblePlatform.mdl There's also a smaller one you can use, I'm using this model for my tackable movement tiles in my upcoming map. |
| 05-11-2008, 08:20 AM | #9 |
I attached the one I use. It's based off KaTTaNa's trackable model. I only removed all the unnecessary vertices, leaving only 4, which is the minimum you need to make a square. The model's dimensions are 256x256x0, so you might want to scale it for your own use (using your favourite model editor), and the (0,0,0) point is located at the center of the square. Since I've been using this for a file, it should work for you. |
| 05-11-2008, 09:34 AM | #10 |
if the model path of a trackable is empty for a player the trackables events will be detected anyway ? so even if you "attach" a player and a trackable you can't be sure which player fire the trackable event ? |
| 05-11-2008, 10:06 AM | #11 |
Have a look at the Trackables in Multiplayer section in KaTTaNa's Trackable Tutorial on wc3jass. |
| 05-11-2008, 10:10 AM | #12 | |
Quote:
I know that i can test myself but i need to ask an other to test with me and why if someone had already test it ? |
| 05-11-2008, 10:25 AM | #13 |
It says that by giving an emtpy string the trackable does not detect events... Just tested the following code with 2 players: JASS:scope A initializer Init function Test1 takes nothing returns nothing call BJDebugMsg("trackable 1") endfunction function Test2 takes nothing returns nothing call BJDebugMsg("trackable 2") endfunction function Init takes nothing returns nothing local trigger trig1 = CreateTrigger() local trigger trig2 = CreateTrigger() local trackable t1 local trackable t2 local string peasant = "units\\human\\Peasant\\Peasant.mdl" local string invisible = "" local string path = invisible if ( GetLocalPlayer() == Player(0) ) then set path = peasant endif set t1 = CreateTrackable(path, -500, 0, 0) set path = invisible if ( GetLocalPlayer() == Player(1) ) then set path = peasant endif set t2 = CreateTrackable(path, -500, 0, 0) call TriggerRegisterTrackableHitEvent(trig1, t1) call TriggerRegisterTrackableHitEvent(trig2, t2) call TriggerAddAction(trig1, function Test1) call TriggerAddAction(trig2, function Test2) endfunction endscope It works fine. |
| 05-11-2008, 10:27 AM | #14 |
thx, sorry i didn't see this sentence |
