[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > Triggers & Scripts


Triggers & Scripts In this forum you may ask for help on fixing a trigger or script. But if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone.

Closed Thread
 
Thread Tools
Old 08-10-2012, 11:45 AM   #16 (permalink)
Registered User Kingz
I don't care.
 
Kingz's Avatar
 
Join Date: Jun 2008
Posts: 2,769
Kingz is a splendid one to behold (817)Kingz is a splendid one to behold (817)Kingz is a splendid one to behold (817)Kingz is a splendid one to behold (817)
Techtree Contest #6 - Winner: Demon Race: Kingz has managed to create a WarCraft3 race without importing additional material, yet presenting something unique to the public! A race made by Kingz. 
Sorry for double post, just wanted to say the issue has been resolved.
I resolved to using:
Jass:
    private interface   I
   
        real        x
        real        y
        integer     count
        integer     playerId
        trackable   t
   
        static  trigger TrackEvent = CreateTrigger()
        static  trigger HitEvent = CreateTrigger()
       
        method onTrack takes nothing returns nothing defaults nothing
        method onHit takes nothing returns nothing defaults nothing
   
    endinterface

    private struct   iTrack extends I
   
        static method operator [] takes trackable t returns thistype
            local thistype this = LoadInteger(customInventory.table, customInventory.trackableKey, GetHandleId(t))
            return this
        endmethod
       
        static method operator []= takes trackable t, integer i returns nothing
            call SaveInteger(customInventory.table, customInventory.trackableKey, GetHandleId(t), i)
        endmethod
       
    endstruct

    private struct a extends iTrack

        private method onHit takes nothing returns nothing
            call BJDebugMsg("hit a")
        endmethod
       
        private method onTrack takes nothing returns nothing
            call BJDebugMsg("tracked a")
        endmethod

    endstruct

    private struct b extends iTrack

        private method onHit takes nothing returns nothing
            call BJDebugMsg("hit b")
        endmethod
       
        private method onTrack takes nothing returns nothing
            call BJDebugMsg("tracked b")
        endmethod

    endstruct

     private function Track takes nothing returns boolean
        local iTrack dat = iTrack[GetTriggeringTrackable()]
        if dat.t == null then
            return false
        endif
        call dat.onTrack()
        return false
    endfunction
   
    private function Hit takes nothing returns boolean
        local iTrack dat = iTrack[GetTriggeringTrackable()]
        if dat.t == null then
            return false
        endif
        call dat.onHit()
        return false
    endfunction
__________________
Apheraz Lucent and -Grendel will forever live in my memory, two extraordinary persons taken away from our world before their time.

And so i dedicate my signature to them, a small sign of memory that will forever remain on my profile, for as long as it exists.
I am sad it's all i can do for them now and i hope i never did something to bring them anything but joy in their life.
World is a cruel place, but it was a better place with both of you in it. Miss you both.
Kingz is online now  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 10:26 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle