Objective: This library indexes units so they can be referenced by Index Numbers
auto generated and uniquely assigned to each unit in the system.
Functions
To setup a unit into the system use the function: DUI_Setup(Unit)
To retrieve a units index use the function: DUI_Get_Index_From_Unit(Unit)
To retrieve the unit associated with an index number use: DUI_Get_Unit_From_Index(Index)
Customization
The system uses a DataTable backend, so there is no pre-defining to do regarding size.
By default the system enters every unit that enters the map into the system
to change this modify the DUI_Init trigger to whatever you need or call DUI_Setup(Unit) in your own custom function after disabling DUI_Init.
This library has a DEBUG feature, to enable this modify the DUI_ALLOW_DEBUG variable and set it to true.
Then when in the map type debug in the chat to display unit indexes above their head.
Install Instruction:
1. Download Dustins Unit Indexing.SC2Lib from above link.
2. Open the map you want to use the library in.
3. Open the trigger dialog and make sure the View > Library menu is checked.
4. Right click the Library view area and click Import Library, find the library file you downloaded and open it.
5. Read the instructions on how to use the library.
[UPDATE 8/3/2013] I've Re-factored the code and updated this to use a DataTable so you will not have to worry about max array size anymore. This Library is completely plug and play with no configuration needed.
The best way to achieve this is to have a Record which references your unit.
Inside the record you'd have the variables...
Current Position = Point
Old Position = Point
Moving = Boolean
You'd setup a periodic timer that sets the Current Position and compares it to the Old Position, if it's changed update the old position and keep looping. If it's the same, start a new timer and set the Moving boolean to False, if it's different set the Moving boolean to true.
Then you'd have another trigger that runs when the timer you created ends, check if the moving boolean is false, if so run defeat.
0
@xSun: Go
That game looks horrible :P
0
@Kueken531: Go
I wasn't aware of this feature, Ill check it out!
[EDIT] Didn't work for me.
0
Dustins Unit Indexing Library v1.5
Objective: This library indexes units so they can be referenced by Index Numbers
auto generated and uniquely assigned to each unit in the system.
Functions
Customization
to change this modify the DUI_Init trigger to whatever you need or call DUI_Setup(Unit) in your own custom function after disabling DUI_Init.
Then when in the map type debug in the chat to display unit indexes above their head.
Download Library: http://dl.dropbox.com/u/843426/Dustins%20Unit%20Indexing.SC2Lib
Download Test Map: http://dl.dropbox.com/u/843426/DustinsUnitIndexing.SC2Map
Install Instruction:
1. Download Dustins Unit Indexing.SC2Lib from above link.
2. Open the map you want to use the library in.
3. Open the trigger dialog and make sure the View > Library menu is checked.
4. Right click the Library view area and click Import Library, find the library file you downloaded and open it.
5. Read the instructions on how to use the library.
[UPDATE 8/3/2013] I've Re-factored the code and updated this to use a DataTable so you will not have to worry about max array size anymore. This Library is completely plug and play with no configuration needed.
0
@nrtwenty: Go
Here, I whipped this up.
http://dl.dropbox.com/u/843426/Unit%20Idle%20Check%20By%20Dustin.SC2Map
Tell me if you have any questions about it.
0
@nrtwenty: Go
The best way to achieve this is to have a Record which references your unit.
Inside the record you'd have the variables...
Current Position = Point Old Position = Point Moving = Boolean
You'd setup a periodic timer that sets the Current Position and compares it to the Old Position, if it's changed update the old position and keep looping. If it's the same, start a new timer and set the Moving boolean to False, if it's different set the Moving boolean to true.
Then you'd have another trigger that runs when the timer you created ends, check if the moving boolean is false, if so run defeat.
0
Awesome Idea Mephs.
0
I think controls should be W = Move twoards facing, A and D turn your guy and S walks backwards.
0
@OutsiderXE: Go
I actually didn't mean to reply to you specifically, I'm NA.
0
1.4 Broke my force effects, they now always push the unit south instead of away from the source 360.
Any idea what they did to break it?
0
@OutsiderXE: Go
Can't find it.
God their search algs suck ass.
0
How can you call this HOMM without turn based battles?
As a HOMM fan myself I doubt Ill play this without the core mechanic of HOMM.
0
Im playing it right now :D
0
Man, I was working on a map that used this style of hero shit but was a Savage type made with a commander too. Your work is pretty badass!
0
Not really, no.
0
You're going to have to code your own movement system and range detection and all that. It's cumbersome but doable!
I made this style of map in WC3
Even made my own AI for it. Let me know if you need any pointers!