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

Simple Check System, for getting your info ;)

Level 18
Joined
Oct 18, 2007
Messages
930
Ok i made a small simple system that gets you the information you want to have. If you need some id's or anything this is the thing ^^

Code:
JASS:
//               °                                        Mapmaking since 2006...
//            °
//          °
//         °
//       °°°ÛÜ
//      °°X°ÛÛÛ                          ÛÛÛÛÛÛÛÛ     ÿÜÛÛÛÛÛÛÛÛÜ 
//     °°XX° ÛÛÛ        ßÛÛÛÛÛ        ÛÛÛÛÛÛÛÛÛÛÛÛ   ÛÛÛÛÛÛÛÛÛÛÛÛÛ
//     °XX ° ÛÛÛÛ         ÛÛÛÛÜ     ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//     °XX °  ÛÛÛÛÛ        ÛÛÛÛ    ÛÛÛÛÛß    ßÛÛÛÛÛÛ  ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  
//    °°XXX°° ÛÛÛÛÛÛÜ       ÛÛÛÜ  ÛÛÛÛÛ        ßÛÛÛÛÛ ßÛÛÛÛ    ÛÛÛÛÛÛ  
//   °°°°°°°°  ÛÛÛÛÛÛÛ      ÛÛÛÛ  ÛÛÛÛ                 ÛÛÛÛ      ÛÛÛÛÜ  
//             ÛÛÛÛÛÛÛÛ     ÛÛÛÛ  ÛÛÛÛ        ÛÛÛÛÛÛÛ  ÛÛÛÛÛÜ     ÛÛÛÛ  
//   °°°°°°°°  ÛÛÛÛÛÛÛÛÛ    ÛÛÛÛÜ  ÛÛÛÛÜ     ÛÛÛÛÛÛÛÛ   ÛÛÛÛÛÜ  ÜÛÛÛÛÛÛ  
//   °°XXXXX°   ÛÛÛÛ  ÛÛÛÜ  ÛÛÛÛÛ   ÛÛÛÛÛÛÜ    ßÛÛÛÛÛ   ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  
//   °°XXXXX °° ÛÛÛÛ   ÛÛÛÛÜ ÛÛÛÛ °°°ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ°°° ÛÛÛÛÛÛÛÛÛÛÛÛÛß  
//   °  XXXXX °°ÛÛÛÛÛ°°°°ÛÛÛÛÛÛÛÛ°°XX ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ XXX°°ÛÛÛÛÛÛÛÛÛÛÛ     ÛÛÛ
//   °°  XXXXX ÜÛÛÛÛÛÛ X ÛÛÛÛÛÛÛÛÛ XXX ÛÛÛÛÛÛÛÛÛÛÛ  XXXXXX  ÛÛÛÛÛÛÛ°      ÛÛÛ
//    °°  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX °°°°°°   °°°°
//     °°   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX °°°°°X°°
//      °°°  XXXXXXXXXX  °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° XXXXXXXXXXXXXXXXX°°
//        °°°°°°°°°°°°°°°°                                  °°°°°°°°  XXXXXXX °°°
//                                                                  °°°°°° XX °°
//   ...2008 and still moving on.                                        °°°°°°°
//                                                                             °°
//   Screen Solution: 1280x1024                             Visit [url=http://www.ngo.clan.su]Clan NgO - Main page[/url]!
//
// * * * * * * * * * * * * * * * * *
// * Check System v1.1 by Dynasti  *
// * * * * * * * * * * * * * * * * *
library CheckSystem initializer Init

    globals
        private trigger CheckWidget =   CreateTrigger()
        private trigger CheckPoint  =   CreateTrigger()
        private trigger CheckOrder  =   CreateTrigger()
    
        private constant string OrderedUnitColor             = "|cff00ff00"
        private constant string OrderColor                   = "|cffffcc00"
        private constant string OrderIdColor                 = "|cffffcc00"
        private constant string OrderPointColor              = "|cffffcc00"
        private constant string OrderTargetItemColor         = "|cFF00ffff"
        private constant string OrderTargetDestructableColor = "|cff004000"
        private constant string OrderTargetUnitColor         = "|cffff0000"
        private constant string CordinatesColor              = "|cffffcc00"
        
        private constant string ErrorColor      = "|cffff0000"
        
        private constant string CommonTextColor = "|cffffffff"
        
        private constant real TextLife          = 10.

    endglobals

    private function OrderOrder takes string order, player p, integer orderid, unit u returns nothing
        call DisplayTimedTextToPlayer(p,0,0,TextLife,"\n"+CommonTextColor+"Unit|r "+OrderedUnitColor+GetUnitName(u)+"|r"+CommonTextColor+" Is ordered to "+OrderPointColor+order+"|r"+CommonTextColor+"(|r"+OrderIdColor+I2S(orderid)+"|r"+CommonTextColor+")"+"|r\n")
    endfunction

    private function OrderPoint takes string order, player p, real x, real y, integer orderid, unit u returns nothing
        call DisplayTimedTextToPlayer(p,0,0,TextLife,"\n"+CommonTextColor+"Unit|r "+OrderedUnitColor+GetUnitName(u)+"|r"+CommonTextColor+" Is ordered to "+OrderPointColor+order+"|r"+CommonTextColor+"(|r"+OrderIdColor+I2S(orderid)+"|r"+CommonTextColor+")"+"|r"+CommonTextColor+" at location (|r"+CordinatesColor+R2S(x)+CommonTextColor+",|r"+CordinatesColor+R2S(y)+CommonTextColor+")"+"\n")
    endfunction

    private function OrderTargetItem takes string order, player p, item i, integer orderid, unit u returns nothing
        call DisplayTimedTextToPlayer(p,0,0,TextLife,"\n"+CommonTextColor+"Unit|r "+OrderedUnitColor+GetUnitName(u)+"|r"+CommonTextColor+" Is ordered to "+OrderColor+order+"|r"+CommonTextColor+"(|r"+OrderIdColor+I2S(orderid)+"|r"+CommonTextColor+")"+CommonTextColor+"on item|r "+OrderTargetItemColor+GetItemName(i)+"|r"+CommonTextColor+" at location (|r"+CordinatesColor+R2S(GetItemX(i))+CommonTextColor+",|r"+CordinatesColor+R2S(GetItemY(i))+CommonTextColor+")"+"\n")
    endfunction
    
    private function OrderTargetUnit takes string order, player p, unit t, integer orderid, unit u returns nothing
        call DisplayTimedTextToPlayer(p,0,0,TextLife,"\n"+CommonTextColor+"Unit|r "+OrderedUnitColor+GetUnitName(u)+"|r"+CommonTextColor+" Is ordered to "+OrderColor+order+"|r"+CommonTextColor+"(|r"+OrderIdColor+I2S(orderid)+"|r"+CommonTextColor+")"+CommonTextColor+"on unit|r "+OrderTargetUnitColor+GetUnitName(t)+"|r"+CommonTextColor+" at location (|r"+CordinatesColor+R2S(GetUnitX(t))+CommonTextColor+",|r"+CordinatesColor+R2S(GetUnitY(t))+CommonTextColor+")"+"\n")
    endfunction
    
    private function OrderTargetDestructable takes string order, player p, destructable d, integer orderid, unit u returns nothing
        call DisplayTimedTextToPlayer(p,0,0,TextLife,"\n"+CommonTextColor+"Unit|r "+OrderedUnitColor+GetUnitName(u)+"|r"+CommonTextColor+" Is ordered to "+OrderColor+order+"|r"+CommonTextColor+"(|r"+OrderIdColor+I2S(orderid)+"|r"+CommonTextColor+")"+CommonTextColor+"on destructable|r "+OrderTargetDestructableColor+GetDestructableName(d)+"|r"+CommonTextColor+" at location (|r"+CordinatesColor+R2S(GetDestructableX(d))+CommonTextColor+",|r"+CordinatesColor+R2S(GetDestructableY(d))+CommonTextColor+")"+"\n")
    endfunction
    
    private function FilterWidget takes nothing returns boolean
        local player p=GetOwningPlayer(GetTriggerUnit())
        if GetOrderTargetUnit() != null then
            call OrderTargetUnit(OrderId2String(GetIssuedOrderId()),p,GetOrderTargetUnit(),GetIssuedOrderId(),GetTriggerUnit())
        elseif GetOrderTargetItem() != null then
            call OrderTargetItem(OrderId2String(GetIssuedOrderId()),p,GetOrderTargetItem(),GetIssuedOrderId(),GetTriggerUnit())
        elseif GetOrderTargetDestructable() != null then
            call OrderTargetDestructable(OrderId2String(GetIssuedOrderId()),p,GetOrderTargetDestructable(),GetIssuedOrderId(),GetTriggerUnit())
        endif
        set p=null
        return false
    endfunction
    
    private function FilterPoint takes nothing returns boolean
        local player p=GetOwningPlayer(GetTriggerUnit())
        call OrderPoint(OrderId2String(GetIssuedOrderId()),p,GetOrderPointX(),GetOrderPointY(),GetIssuedOrderId(),GetTriggerUnit())
        set p=null
        return false
    endfunction
    
    private function FilterOrder takes nothing returns boolean
        local player p=GetOwningPlayer(GetTriggerUnit())
        call OrderOrder(OrderId2String(GetIssuedOrderId()),p,GetIssuedOrderId(),GetTriggerUnit())
        set p=null
        return false
    endfunction

    function CheckWidgetOrder takes boolean condition returns nothing
        if condition == false then
            if IsTriggerEnabled(CheckWidget) then
                call DisableTrigger(CheckWidget)
                call BJDebugMsg("\n"+CommonTextColor+"CheckWidget System Disabled!|r\n")
            else
                call BJDebugMsg("\n"+ErrorColor+"Cannot Disable a Disabled Trigger!|r\n")
            endif
        else
            if not IsTriggerEnabled(CheckWidget) then
                call EnableTrigger(CheckWidget)
                call BJDebugMsg("\n"+CommonTextColor+"CheckWidget System Enabled!|r\n")
            else
                call BJDebugMsg("\n"+ErrorColor+"Cannot Enable an Enabled Trigger!|r\n")
            endif
        endif
    endfunction
    
    function CheckPointOrder takes boolean state returns nothing
        if state == false then
            if IsTriggerEnabled(CheckPoint) then
                call DisableTrigger(CheckPoint)
                call BJDebugMsg("\n"+CommonTextColor+"CheckPoint System Disabled!|r\n")
            else
                call BJDebugMsg("\n"+ErrorColor+"Cannot Disable a Disabled Trigger!|r\n")
            endif
        else
            if not IsTriggerEnabled(CheckPoint) then
                call EnableTrigger(CheckPoint)
                call BJDebugMsg("\n"+CommonTextColor+"CheckPoint System Enabled!|r\n")
            else
                call BJDebugMsg("\n"+ErrorColor+"Cannot Enable an Enabled Trigger!|r\n")
            endif
        endif
    endfunction

    function CheckOrderOrder takes boolean state returns nothing
        if state == false then
            if IsTriggerEnabled(CheckOrder) then
                call DisableTrigger(CheckOrder)
                call BJDebugMsg("\n"+CommonTextColor+"CheckOrder System Disabled!|r\n")
            else
                call BJDebugMsg("\n"+ErrorColor+"Cannot Disable a Disabled Trigger!|r\n")
            endif
        else
            if not IsTriggerEnabled(CheckOrder) then
                call EnableTrigger(CheckOrder)
                call BJDebugMsg("\n"+CommonTextColor+"CheckOrder System Enabled!|r\n")
            else
                call BJDebugMsg("\n"+ErrorColor+"Cannot Enable an Enabled Trigger!|r\n")
            endif
        endif
    endfunction
//===========================================================================
    private function Init takes nothing returns nothing
        local integer index=0
        local player p=null
        loop
            set p=Player(index)
            call TriggerRegisterPlayerUnitEvent(CheckWidget,p,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null)
            call TriggerRegisterPlayerUnitEvent(CheckPoint,p,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
            call TriggerRegisterPlayerUnitEvent(CheckOrder,p,EVENT_PLAYER_UNIT_ISSUED_ORDER,null)
            set p=null
            set index=index+1
            exitwhen index==bj_MAX_PLAYER_SLOTS
        endloop
        call TriggerAddCondition(CheckWidget,Condition(function FilterWidget))
        call TriggerAddCondition(CheckPoint,Condition(function FilterPoint))
        call TriggerAddCondition(CheckOrder,Condition(function FilterOrder))
        call DisableTrigger(CheckWidget)
        call DisableTrigger(CheckPoint)
        call DisableTrigger(CheckOrder)
    endfunction

endlibrary

Please post ways of improvement ^^ Enjoy

History
v1.0 Release

v1.1 Fixed that it does show up "... ... ... ... on Unit" instead of just unit
Test Map:
 

Attachments

  • Check System.w3x
    18.9 KB · Views: 143
Last edited:
Level 22
Joined
Jun 24, 2008
Messages
3,050
Not really, but it could be usefull, to check ranges (Etc, if you want a spell to be this far, then just click, then the system checks the range, so that youd ont have to try many times.) Also, it would be kinda neat, if you could :D

Edit: Could you use 'local' players (Or just owner of triggering unit) So this would be able to check for multiple players?
 
Level 18
Joined
Oct 18, 2007
Messages
930
As i see it, this text is all shown to player 0. (Red).

Could you make it show to the owner of the orderet unit?
Cause then people who know eachother RL, and works on a map, can test multiple things at same time, without spamming red.

no... it is shown to the owner... look closely..
JASS:
local player p=GetOwningPlayer(GetTriggerUnit())
 
Top