wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 08-23-2009, 11:16 PM   #31
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Here's some progress, though I haven't syntax checked or test this, it should work.

Collapse JASS:
library MinimapIcons initializer Init requires TimedLoop
    //=================================================================================
    // MinimapIcons Library, by Pyrogasm - V1.00 (August 23, 2009)
    //    [A library to treat minimap unit icons as objects]
    //
    //=================================================================================

    globals
        private constant integer UNIT_ICON_ID = 'Uicn'
        private constant integer HERO_ICON_ID = 'Hicn'

        private constant real UPDATE_PERIOD = 0.04

        private constant player DEFAULT_PLAYER = Player(15)
        private constant real DEFAULT_X = 0.00
        private constant real DEFAULT_Y = 0.00

        private constant integer ICON_TYPE_UNIT = 0
        private constant integer ICON_TYPE_HERO = 1
    endglobals

    globals
        private timer T
        private integer N = 0
        private keyword MinimapIcon
        private MinimapIcon array MIArray
        private boolean B
    endglobals

    struct MinimapIcon
        private unit I = null
        private integer IType
        private real IX = 0.00
        private real IY = 0.00
        private unit ITarget = null
        private player IPlayer
        private integer Index = -1

        static method create takes integer iconType returns MinimapIcon
            local MinimapIcon M = MinimapIcon.allocate()
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            set M.I = CreateUnit(DEFAULT_PLAYER, Id, DEFAULT_X, DEFAULT_Y, 0.00)
            set M.IType = iconType
            call ShowUnit(M.I, false)

            return M
        endmethod

        method operator X takes nothing returns real
            return .IX
        endmethod

        method operator X= takes real v returns nothing
            set .IX = v
            call SetUnitX(.I, .IX)

            if .ITarget != null then
                call .StopFollowing()
            endif
        endmethod

        method operator Y takes nothing returns real
            return .IY
        endmethod

        method operator Y= takes real v returns nothing
            set .IY = v
            call SetUnitY(.I, .IY)

            if .ITarget != null then
                call .FollowTarget(false)
            endif
        endmethod

        method operator Target takes nothing returns unit
            return .ITarget
        endmethod

        method operator Target= takes unit v returns nothing
            set .ITarget = v
        endmethod

        method operator IconType takes nothing returns integer
            return IType
        endmethod

        method operator IconType= takes integer v returns nothing
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            call ShowUnit(.I, true)
            call RemoveUnit(.I)
            set .I = CreateUnit(.IPlayer, Id, .IX, .IY, 0.00)
            call ShowUnit(.I, false)
        endmethod

        method operator OwningPlayer takes nothing returns player
            return .IPlayer
        endmethod

        method operator OwningPlayer= takes player v returns nothing
            set .IPlayer = v
            call SetUnitOwner(.I, v, true)
        endmethod

        method ShowForPlayer takes player whichPlayer, boolean flag returns nothing
            if flag and GetLocalPlayer() == whichPlayer then
                call ShowUnit(.I, true)
            elseif not(flag) and GetLocalPlayer() == whichPlayer then
                call ShowUnit(.I, false)
            endif
        endmethod

        private static method ForceEnum takes nothing returns nothing
            if B and GetLocalPlayer() == GetEnumPlayer() then
                call ShowUnit(.I, true)
            elseif not(B) and GetLocalPlayer() == GetEnumPlayer() then
                call ShowUnit(.I, false)
            endif
        endmethod

        method ShowForForce takes force whichForce, boolean flag returns nothing
            set B = flag
            call ForForce(whichForce, MinimapIcon.ForceEnum)
        endmethod

        private static method Periodic takes nothing returns nothing
            local integer J = 0
            local MinimapIcon M

            loop
                set M = MIArray[J]
                set M.IX = GetUnitX(M.Target)
                set M.IY = GetUnitY(M.Target)
                call SetUnitX(M.I, M.IX)
                call SetUnitY(M.I, M.IY)

                set J = J+1
                exitwhen J >= N
            endloop
        endmethod

        method FollowTarget takes boolean flag returns nothing
            if flag then
                set MIArray[N] = this
                set .Index = N
                set N = N+1

                if N == 1 then
                    call TimerStart(T, UPDATE_PERIOD, MinimapIcon.Periodic, true)
                endif
            elseif .Index > -1 then
                set N = N-1
                if N > 0 then
                    set MIArray[.Index] = MIArray[N]
                else
                    set .Index = -1
                    call PauseTimer(T)
                endif
            else
                debug call BJDebugMsg("|cffffcc00MinimapIcon Warning: called .FollowTarget(false) on an instance that was not following!")
            endif
        endmethod

        method onDestroy takes nothing returns nothing
            if .Index > -1 then
                set N = N-1
                if N > 0 then
                    set MIArray[.Index] = MIArray[N]
                else
                    call PauseTimer(T)
                endif
            endif
        endmethod
    endstruct

    private function Init takes nothing returns nothing
        set T = CreateTimer()
    endfunction
endlibrary
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-24-2009, 04:22 AM   #32
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

hummm.. looks you have done some work there

But (iam really sorry for this) as im a jass illiterate, im gonna have to ask you if you could implement it on a map :/. Coz i have no idea when to call anything

it needs timedloop which i found (think so)

but still got this error

call .StopFollowing()
it says it is not a member of minimapicons__minimapicon
__________________
Darkrider[DT]

Last edited by Darkrider : 08-24-2009 at 04:29 AM.
Darkrider is offline   Reply With Quote
Old 08-24-2009, 05:56 AM   #33
Deaod
User
 
Join Date: Jan 2007
Posts: 541

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Send a message via ICQ to Deaod Send a message via MSN to Deaod
Default

Collapse JASS:
        method operator X= takes real v returns nothing
            set .IX = v
            call SetUnitX(.I, .IX)

            if .ITarget != null then
                call .StopFollowing()
            endif
        endmethod

        method operator Y takes nothing returns real
            return .IY
        endmethod

        method operator Y= takes real v returns nothing
            set .IY = v
            call SetUnitY(.I, .IY)

            if .ITarget != null then
                call .FollowTarget(false)
            endif
        endmethod

replace "call .StopFollowing()" with "call .FollowTarget(false)"
__________________
Deaod is offline   Reply With Quote
Old 08-24-2009, 10:19 AM   #34
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Ah, whoops. It doesn't need TimedLoop; I forgot to remove that.
And no guarantees on it working yet, either. I haven't had a chance to test.

If you want to go ahead and see if it works, make 2 new units on your map: one regular unit and one hero unit. Do whatever you'd normally do to make dummy units except don't turn their minimap display off, and then update the library's rawcodes.

Collapse JASS:
library MinimapIcons initializer Init
    //=================================================================================
    // MinimapIcons Library, by Pyrogasm - V1.01 (August 24, 2009)
    //    [A library to treat minimap unit icons as objects]
    //
    //=================================================================================

    globals
        private constant integer UNIT_ICON_ID = 'Uicn'
        private constant integer HERO_ICON_ID = 'Hicn'

        private constant real UPDATE_PERIOD = 0.04

        private constant player DEFAULT_PLAYER = Player(15)
        private constant real DEFAULT_X = 0.00
        private constant real DEFAULT_Y = 0.00

        private constant integer ICON_TYPE_UNIT = 0
        private constant integer ICON_TYPE_HERO = 1
    endglobals

    globals
        private timer T
        private integer N = 0
        private keyword MinimapIcon
        private MinimapIcon array MIArray
        private boolean B
    endglobals

    struct MinimapIcon
        private unit I = null
        private integer IType
        private real IX = 0.00
        private real IY = 0.00
        private unit ITarget = null
        private player IPlayer
        private integer Index = -1

        static method create takes integer iconType returns MinimapIcon
            local MinimapIcon M = MinimapIcon.allocate()
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            set M.I = CreateUnit(DEFAULT_PLAYER, Id, DEFAULT_X, DEFAULT_Y, 0.00)
            set M.IType = iconType
            call ShowUnit(M.I, false)

            return M
        endmethod

        method operator X takes nothing returns real
            return .IX
        endmethod

        method operator X= takes real v returns nothing
            set .IX = v
            call SetUnitX(.I, .IX)

            if .ITarget != null then
                call .FollowTarget(false)
            endif
        endmethod

        method operator Y takes nothing returns real
            return .IY
        endmethod

        method operator Y= takes real v returns nothing
            set .IY = v
            call SetUnitY(.I, .IY)

            if .ITarget != null then
                call .FollowTarget(false)
            endif
        endmethod

        method operator Target takes nothing returns unit
            return .ITarget
        endmethod

        method operator Target= takes unit v returns nothing
            set .ITarget = v
        endmethod

        method operator IconType takes nothing returns integer
            return IType
        endmethod

        method operator IconType= takes integer v returns nothing
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            call ShowUnit(.I, true)
            call RemoveUnit(.I)
            set .I = CreateUnit(.IPlayer, Id, .IX, .IY, 0.00)
            call ShowUnit(.I, false)
        endmethod

        method operator OwningPlayer takes nothing returns player
            return .IPlayer
        endmethod

        method operator OwningPlayer= takes player v returns nothing
            set .IPlayer = v
            call SetUnitOwner(.I, v, true)
        endmethod

        method ShowForPlayer takes player whichPlayer, boolean flag returns nothing
            if flag and GetLocalPlayer() == whichPlayer then
                call ShowUnit(.I, true)
            elseif not(flag) and GetLocalPlayer() == whichPlayer then
                call ShowUnit(.I, false)
            endif
        endmethod

        private static method ForceEnum takes nothing returns nothing
            if B and GetLocalPlayer() == GetEnumPlayer() then
                call ShowUnit(.I, true)
            elseif not(B) and GetLocalPlayer() == GetEnumPlayer() then
                call ShowUnit(.I, false)
            endif
        endmethod

        method ShowForForce takes force whichForce, boolean flag returns nothing
            set B = flag
            call ForForce(whichForce, MinimapIcon.ForceEnum)
        endmethod

        private static method Periodic takes nothing returns nothing
            local integer J = 0
            local MinimapIcon M

            loop
                set M = MIArray[J]
                set M.IX = GetUnitX(M.Target)
                set M.IY = GetUnitY(M.Target)
                call SetUnitX(M.I, M.IX)
                call SetUnitY(M.I, M.IY)

                set J = J+1
                exitwhen J >= N
            endloop
        endmethod

        method FollowTarget takes boolean flag returns nothing
            if flag then
                set MIArray[N] = this
                set .Index = N
                set N = N+1

                if N == 1 then
                    call TimerStart(T, UPDATE_PERIOD, MinimapIcon.Periodic, true)
                endif
            elseif .Index > -1 then
                set N = N-1
                if N > 0 then
                    set MIArray[.Index] = MIArray[N]
                else
                    set .Index = -1
                    call PauseTimer(T)
                endif
            else
                debug call BJDebugMsg("|cffffcc00MinimapIcon Warning: called .FollowTarget(false) on an instance that was not following!")
            endif
        endmethod

        method onDestroy takes nothing returns nothing
            if .Index > -1 then
                set N = N-1
                if N > 0 then
                    set MIArray[.Index] = MIArray[N]
                else
                    call PauseTimer(T)
                endif
            endif
        endmethod
    endstruct

    private function Init takes nothing returns nothing
        set T = CreateTimer()
    endfunction
endlibrary
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 08-24-2009, 12:25 PM   #35
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

:P

ok i'll try what you said as soon as i get home.


EDIT:

Please let me know when you can test it, because im getting a lot of compiling errors regarding undeclared variable types and things like that :P
__________________
Darkrider[DT]

Last edited by Darkrider : 08-25-2009 at 03:49 AM.
Darkrider is offline   Reply With Quote
Old 08-25-2009, 11:02 AM   #36
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Whenever I boot into Windows, which hasn't been for a while.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 08-26-2009, 03:49 AM   #37
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

or else, if you want, i can post the errors i get :P
__________________
Darkrider[DT]
Darkrider is offline   Reply With Quote
Old 08-31-2009, 04:33 AM   #38
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

this are the errors i get. Can you help me ?




__________________
Darkrider[DT]

Last edited by Darkrider : 08-31-2009 at 04:33 AM.
Darkrider is offline   Reply With Quote
Old 09-05-2009, 04:16 PM   #39
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

Pyrogasm can you help me here :(
__________________
Darkrider[DT]
Darkrider is offline   Reply With Quote
Old 09-08-2009, 03:56 AM   #40
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

It's been a while, but I've been on vacation. This should work:

Collapse JASS:
library MinimapIcons initializer Init
    //==========================================================================================
    // MinimapIcons Library, by Pyrogasm - V1.03 (September 7th, 2009)
    //    [A library to treat minimap unit icons as objects]
    //
    // The outset of this system is very simple: there may be some instances in which
    //  a mapmaper wishes to display a unit or hero icon on the minimap for specific
    //  players, for whatever reason. Currently there is no API to support this, thus
    //  this library was written.
    //
    //
    // ==============
    // The most relevant part of this library is a new object, the MinimapIcon
    //   local MinimapIcon M = MinimapIcon.create(ICON_TYPE_UNIT)
    //    - Allocates a new MinimapIcon object with a unit icon
    //
    //   local MinimapIcon M = MinimapIcon.createXY(ICON_TYPE_UNIT, SomeX, SomeY, Player(0))
    //    - The same as above but creates it at (SomeX, SomeY) for Player(0)
    //
    //   local MinimapIcon M = MinimapIcon.createTarget(ICON_TYPE_UNIT, Targ, Player(0), flag)
    //    - The same, but creates it at Targ's coordinates, and will .FollowTarget(flag)
    //
    //   M.IconUnit           - Returns the unit being used to display the icon (Read Only) 
    //   set M.X = 3.00       - Sets the icon's X coordinate to 3.00
    //   set M.Y = 5.00       - Sets the icon's Y coordinate to 5.00
    //   M.X                  - Would return 3.00 (the icon's X coordinate)
    //   M.Y                  - Would return 5.00 (the icon's Y coordinate)
    //   set M.Target = U     - Sets the icon's target to U
    //   M.Target             - Would return U
    //   set M.IconType =     - Sets the current IconType to ICON_TYPE_UNIT or ICON_TYPE_HERO
    //                           (When called, this resets the current Display options and
    //                            will hide the MinimapIcon for all players)
    //   M.IconType           - Returns the current IconType
    //   set M.OwningPlayer = - Sets the owning player for the icon, thus changing the display
    //                           color on the minimap
    //   M.OwningPlayer       - Returns the current owning player
    //
    //   call M.ShowForPlayer(P, Bool) - Shows the icon for player P if Bool is true; if Bool
    //                                    is false, the icon will be hidden for P
    //   call M.ShowForForce(F, Bool)  - The same as the above, but will show/hide for the
    //                                    specified force
    //
    // ==============
    // There are also a few constants you might want to modify:
    //   UNIT_ICON_ID   - The rawcode of the unit icon unit
    //   HERO_ICON_ID   - The rawcode of the hero icon unit
    //   UPDATE_PERIOD  - The timeout of the timer that moves target-following icons
    //   DEFAULT_PLAYER - When .create is called, the icon will be created for this player
    //   DEFAULT_X      - When .create is called, the icon will be created at this X coordinate
    //   DEFAULT_Y      - When .create is called, the icon will be created at this Y coordinate
    //   ICON_TYPE_UNIT - For use with unit icons
    //   ICON_TYPE_HERO - For use with hero icons
    //
    //
    // ==============
    // Units:
    //   This system uses two dummy units to display the icons, and they are created with
    //    external ObjectMerger calls. After saving this script in your map the first time,
    //    simply find the two lines that start with "//! external ObjectMerger" and put a space
    //    between the // and the !
    //
    //
    // ==============
    // Credit where it's due:
    //   Vexorian, for JASSHelper
    //   Pitzermike, for PJass and Grimoire
    //   Pipedream, Zoxc, and MindWorx, for the JassNewGen Pack
    //   grim001, for a little help with static method callbacks
    //   _, for the inspiration to create this system
    //
    //==========================================================================================

    globals
        private constant integer UNIT_ICON_ID = 'uicn'
        private constant integer HERO_ICON_ID = 'Hicn'

        private constant real UPDATE_PERIOD = 0.04

        private constant player DEFAULT_PLAYER = Player(15)
        private constant real DEFAULT_X = 0.00
        private constant real DEFAULT_Y = 0.00

        constant key ICON_TYPE_UNIT
        constant key ICON_TYPE_HERO
    endglobals

    globals
        private timer T
        private integer N = 0
        private MinimapIcon array MIArray
        private boolean B
        private MinimapIcon Hold
    endglobals

    //! external ObjectMerger w3u ewsp uicn uabi Aloc umdl none.mdl ussc -1.00 uspa 0 umvs 0 ucol 0.00 ufoo 0 urac Commoner usid 0 usin 0 utyp 0 ubui 0 upgr 0 unam "Unit Icon"
    //! external ObjectMerger w3u ewsp Hicn uabi Aloc umdl none.mdl ussc -1.00 uspa 0 umvs 0 ucol 0.00 ufoo 0 urac Commoner usid 0 usin 0 utyp 0 ubui 0 upgr 0 unam "Hero Icon"

    struct MinimapIcon
        private unit I = null
        private integer IType
        private real IX = 0.00
        private real IY = 0.00
        private unit ITarget = null
        private player IPlayer
        private integer Index = -1

        method operator IconUnit takes nothing returns unit
            return .I
        endmethod

        method operator X takes nothing returns real
            return .IX
        endmethod

        method operator X= takes real v returns nothing
            set .IX = v
            call SetUnitX(.I, .IX)

            if .ITarget != null then
                call .FollowTarget(false)
            endif
        endmethod

        method operator Y takes nothing returns real
            return .IY
        endmethod

        method operator Y= takes real v returns nothing
            set .IY = v
            call SetUnitY(.I, .IY)

            if .ITarget != null then
                call .FollowTarget(false)
            endif
        endmethod

        method operator Target takes nothing returns unit
            return .ITarget
        endmethod

        method operator Target= takes unit v returns nothing
            set .ITarget = v
        endmethod

        method operator IconType takes nothing returns integer
            return .IType
        endmethod

        method operator IconType= takes integer v returns nothing
            local integer Id = UNIT_ICON_ID

            if v == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            if v != .IType then
                call ShowUnit(.I, true)
                call RemoveUnit(.I)
                set .I = CreateUnit(.IPlayer, Id, .IX, .IY, 0.00)
                call ShowUnit(.I, false)

                set .IType = v
            endif
        endmethod

        method operator OwningPlayer takes nothing returns player
            return .IPlayer
        endmethod

        method operator OwningPlayer= takes player v returns nothing
            set .IPlayer = v
            call SetUnitOwner(.I, v, true)
        endmethod

        method ShowForPlayer takes player whichPlayer, boolean flag returns nothing
            if flag and GetLocalPlayer() == whichPlayer then
                call ShowUnit(.I, true)
            elseif not(flag) and GetLocalPlayer() == whichPlayer then
                call ShowUnit(.I, false)
            endif
        endmethod

        private static method ForceEnum takes nothing returns nothing
            if B and GetLocalPlayer() == GetEnumPlayer() then
                call ShowUnit(Hold.I, true)
            elseif not(B) and GetLocalPlayer() == GetEnumPlayer() then
                call ShowUnit(Hold.I, false)
            endif
        endmethod

        method ShowForForce takes force whichForce, boolean flag returns nothing
            set B = flag
            set Hold = this
            call ForForce(whichForce, function MinimapIcon.ForceEnum)
        endmethod

        private static method Periodic takes nothing returns nothing
            local integer J = 0
            local MinimapIcon M

            loop
                set M = MIArray[J]
                set M.IX = GetUnitX(M.Target)
                set M.IY = GetUnitY(M.Target)
                call SetUnitX(M.I, M.IX)
                call SetUnitY(M.I, M.IY)

                set J = J+1
                exitwhen J >= N
            endloop
        endmethod

        method FollowTarget takes boolean flag returns nothing
            if flag then
                set MIArray[N] = this
                set .Index = N
                set N = N+1

                if N == 1 then
                    call TimerStart(T, UPDATE_PERIOD, true, function MinimapIcon.Periodic)
                endif
            elseif .Index > -1 then
                set N = N-1
                if N > 0 then
                    set MIArray[.Index] = MIArray[N]
                else
                    set .Index = -1
                    call PauseTimer(T)
                endif
            else
                debug call BJDebugMsg("|cffffcc00MinimapIcon Warning: called .FollowTarget(false) on an instance that was not following!")
            endif
        endmethod


        static method create takes integer iconType returns MinimapIcon
            local MinimapIcon M = MinimapIcon.allocate()
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            set M.I = CreateUnit(DEFAULT_PLAYER, Id, DEFAULT_X, DEFAULT_Y, 0.00)
            set M.IType = iconType
            call ShowUnit(M.I, false)

            return M
        endmethod

        static method createXY takes integer iconType, real X, real Y, player P returns MinimapIcon
            local MinimapIcon M = MinimapIcon.allocate()
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            set M.I = CreateUnit(DEFAULT_PLAYER, Id, DEFAULT_X, DEFAULT_Y, 0.00)
            set M.IType = iconType
            set M.X = X
            set M.Y = Y
            set M.OwningPlayer = P

            call ShowUnit(M.I, false)

            return M
        endmethod

        static method createTarget takes integer iconType, unit T, player P, boolean Follow returns MinimapIcon
            local MinimapIcon M = MinimapIcon.allocate()
            local integer Id = UNIT_ICON_ID

            if iconType == ICON_TYPE_HERO then
                set Id = HERO_ICON_ID
            endif

            set M.I = CreateUnit(DEFAULT_PLAYER, Id, DEFAULT_X, DEFAULT_Y, 0.00)
            set M.IType = iconType
            set M.Target = T
            set M.OwningPlayer = P

            if Follow then
                call M.FollowTarget(true)
            endif

            call ShowUnit(M.I, false)

            return M
        endmethod

        method onDestroy takes nothing returns nothing
            call RemoveUnit(.I)

            if .Index > -1 then
                set N = N-1
                if N > 0 then
                    set MIArray[.Index] = MIArray[N]
                else
                    call PauseTimer(T)
                endif
            endif
        endmethod
    endstruct

/*    function OnX takes unit U, real X returns nothing
        call BJDebugMsg(GetUnitName(U))
    endfunction

    hook SetUnitX OnX

    private function Init takes nothing returns nothing
        set T = CreateTimer()
    endfunction
*/
endlibrary
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 09-08-2009, 12:08 PM
Darkrider
This message has been deleted by Darkrider.
Old 09-09-2009, 04:42 AM   #41
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

Ok im gonna try this ASAP and bring some feedback


Thx a lot for it ^^

(and sorry if i've been too repetitive)

EDIT:
I get this error and as iam a noob i cant solve it, i know this is something stupid... but i dont know where to put the return nothing thing :(

__________________
Darkrider[DT]
Darkrider is offline   Reply With Quote
Old 09-09-2009, 07:26 AM   #42
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

That's just a NewGen thing. You should be able to just click 'Accept' and it will enable the trigger anyway.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 09-09-2009, 07:28 AM   #43
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

I doubt he has JNGP...

Edit: Or he disabled "Disable editor error messages"
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 09-09-2009 at 07:28 AM.
Anachron is offline   Reply With Quote
Old 09-09-2009, 12:43 PM
Darkrider
This message has been deleted by Darkrider.
Old 09-10-2009, 04:35 AM   #44
Darkrider
User
 
Join Date: Mar 2008
Posts: 93

Darkrider has little to show at this moment (0)

Default

i have JNGP and i have disabled editor error messages

else i would also get an error with artificial's recype system or other jass script i used to have like Pandamine's AMHS (now i only have it's replay detect engine) and i dont :P

Yes, the trigger remains enabled but i cant test it from WE, so i'll have to try to load it from wc3

EDIT:

Im having this problem



i have jass helper version 0.9.K.0 and JNGP for 1.24, i have disabled WE syntax checker and all those things... what can i do?

Btw i cant play the map on warcraft (players do not appear in lobby)


EDIT: WoW... i wrote this inside the library (before structs) and it saved the map o.O

Collapse JASS:
    function Init takes nothing returns nothing
        endfunction

but i still cant make it work (the minimap icons are not displayed)
__________________
Darkrider[DT]

Last edited by Darkrider : 09-10-2009 at 05:19 AM.
Darkrider is offline   Reply With Quote
Old 09-10-2009, 02:36 PM   #45
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,514

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I don't know what's up with you, but it saves/works just fine for me without errors at all. Try downloading .K.0 again and overwriting the old jasshelper.exe, clijasshelper.exe, and the .conf files.

At any rate, try opening the attached map and saving it.

Press escape in-game to show an icon for all the riflemen.
Attached Files
File Type: w3x Generic Code Compiling Map.w3x (34.5 KB, 4 views)
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.

Last edited by Pyrogasm : 09-10-2009 at 02:49 PM.
Pyrogasm is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 11:25 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services