U are a noob
Mega Super Ultra Cool Member
- Reaction score
- 152
This system was made by Uareanoob.
Small math help from Pyrogasm.
Give credit when used.
v1.02
How to use:
When making a spell all you need to do is make all of your variables arrays and then use the casting units custom value to reference the array number.
This system uses custom values and array to make certain things some what MUI. Every thing you want MUI you need to make it a array.This system only makes it MUI nor SUI (same unit instantaniable.)
What this system does is it has 2 variables that are used one is a variable that stores the amount of units a player currently has. Another variable takes that value and then it subtracts it by 1 then multiplys by maxplayers and then adds the players number to it and then sets the units custom value. This does some thing like this:
Player 1 : Unit 1 = 1 Unit 2 = 17
Player 2 : Unit 1 = 2 Unit 2 = 18
and so on....
Formula : (n-1)*16 + PlayerNumberOf
Max units is 8191 and about 500+ units per player.
________________________
Check Out my MUI System for GUI
Small math help from Pyrogasm.
Give credit when used.
v1.02
How to use:
When making a spell all you need to do is make all of your variables arrays and then use the casting units custom value to reference the array number.
This system uses custom values and array to make certain things some what MUI. Every thing you want MUI you need to make it a array.This system only makes it MUI nor SUI (same unit instantaniable.)
What this system does is it has 2 variables that are used one is a variable that stores the amount of units a player currently has. Another variable takes that value and then it subtracts it by 1 then multiplys by maxplayers and then adds the players number to it and then sets the units custom value. This does some thing like this:
Player 1 : Unit 1 = 1 Unit 2 = 17
Player 2 : Unit 1 = 2 Unit 2 = 18
and so on....
Formula : (n-1)*16 + PlayerNumberOf
Max units is 8191 and about 500+ units per player.
It assigns each unit on the map a number, which is then stored as the unit's Custom Value. The value is calculated in this line: "Set MUI_Unit_Vaule = (((MUI_Player_Total[(Player number of (Owner of (Picked unit)))] - 1) x MaxPlayers) + (Player number of (Owner of (Picked unit))))".
What that means is this: ((TheNthUnitOfTheOwningPlayer) - 1) x (TotalNumberOfPlayers) + (ThePlayerNumberOfTheOwnerOfTheUnit)
So, for instance, the 5th unit of Player 1 when there are 12 players would be: (5 - 1) x 12 + 1 = 49; this number is unique, and each unit has its own number.
When a unit casts a spell, it simply uses arrays of whatever variables you need with an index of the unit's cusom value.
Code:
MUI Start
Events
Map initialization
Conditions
Actions
-------- ~~~~~~~~~~~~~~~~~Variables~~~~~~~~~~~~~~~~~ --------
-------- MaxPlayers- This determines the max amount of players you will be using in this system. --------
Set MaxPlayers = 16
-------- Testing- End~Type: Integer~Defualt: 16 --------
-------- ~~~~~~~~~~~~~~~~~Variables - End~~~~~~~~~~~~~~~~~ --------
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is Summoned) Not equal to True)) and do (Actions)
Loop - Actions
Set MUI_Player_Total[(Player number of (Picked player))] = (MUI_Player_Total[(Player number of (Picked player))] + 1)
Set MUI_Unit_Vaule = ((((MUI_Player_Total[(Player number of (Picked player))] - 1) x MaxPlayers) + (Player number of (Picked player))) + (Player number of (Picked player)))
Unit - Set the custom value of (Picked unit) to MUI_Unit_Vaule
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Testing Equal to True
Then - Actions
Game - Display to (All players) the text: ((String(MUI_Player_Total[(Player number of (Picked player))])) + (. + (String((Custom value of (Picked unit))))))
Else - Actions
Code:
MUI New Units
Events
Unit - A unit enters (Playable map area)
Conditions
And - All (Conditions) are true
Conditions
((Triggering unit) is Summoned) Equal to False
(Custom value of (Triggering unit)) Equal to 0
Actions
Set MUI_Player_Total[(Player number of (Owner of (Triggering unit)))] = (MUI_Player_Total[(Player number of (Owner of (Triggering unit)))] + 1)
Set MUI_Unit_Vaule = (((MUI_Player_Total[(Player number of (Owner of (Triggering unit)))] - 1) x MaxPlayers) + (Player number of (Owner of (Triggering unit))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MUI_Unit_Vaule Greater than 8191
Then - Actions
Set MUI_Unit_Vaule = 0
For each (Integer A) from 1 to 8191, do (Actions)
Loop - Actions
Set UnitNumber = (((IntegerPool[(Integer A)] - (Player number of (Owner of (Triggering unit)))) / MaxPlayers) + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
IntegerPool[(Integer A)] Not equal to 0
(((UnitNumber - 1) x MaxPlayers) + (Player number of (Owner of (Triggering unit)))) Equal to IntegerPool[(Integer A)]
Then - Actions
Set MUI_Unit_Vaule = IntegerPool[(Integer A)]
Set IntegerPool[(Integer A)] = 0
Custom script: exitwhen true
Else - Actions
Else - Actions
Unit - Set the custom value of (Triggering unit) to MUI_Unit_Vaule
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Testing Equal to True
Then - Actions
Game - Display to (All players) the text: ((String(MUI_Player_Total[(Player number of (Owner of (Triggering unit)))])) + (. + (String((Custom value of (Triggering unit))))))
Else - Actions
Code:
MUI Die
Events
Unit - A unit Dies
Conditions
And - All (Conditions) are true
Conditions
((Triggering unit) is A Hero) Equal to False
(Custom value of (Triggering unit)) Not equal to 0
Actions
Set IntegerPool[(Execution count of (This trigger))] = (Custom value of (Triggering unit))
Unit - Set the custom value of (Triggering unit) to 0
Code:
This system was made by Uareanoob.
Small math help from Pyrogasm.
Give credit when used.
v1.02
Links for Updated versions:
http://www.thehelper.net/forums/showthread.php?t=58815
http://www.wc3campaigns.net/showthread.php?t=95131
http://www.hiveworkshop.com/resources_new/spells/985/
Every thing you want to be MUI needs to be a array.
~~When using system~~
1. Add Unit - Add classification of Summoned to (Last created unit) to dummy casters if you do not want it to be added to the MUI process.
2. When you need to remove leaks for a spell with arrays you to add this after the "(udg_<variable>)": [GetUnitUserData(GetSpellAbilityUnit())]).
but for other possibilities instead of "GetSpellAbilityUnit" see "Unit List" Trigger Comment.
3. When using periodic events like: "Time - Every 2.00 seconds of game time" you need to use:
"For each (Integer A) from 1 to MaxPlayers, do (Actions)" and then the actions you want with the (Integer A) in the array slots.
4. When using "For Each Integer" loops use "For Each Integer Variable" then create a Variable
for the trigger you are using the loop in and have it be an array integer so you can use it along with the "triggering unit's" custom value.
5. When you lower the variable "MaxPlayers" it removes from the players from the end of the list which means if it is set to 12 it will only
support players 1-12.
6. If you use pre-placed units for doodads or destructible then you must add the class "Summoned" to the unit's "Stats- Unit Classification".
Code:
v1.02
Full Unit List:
1.GetLastCreatedUnit() - (Last created unit)
2.GetLastRestoredUnitBJ()/GetLastRestoredUnit() - (Last restored unit)
3.GetLastReplacedUnitBJ()/GetLastReplacedUnit() - (Last replaced unit)
4.GetLastHauntedGoldMine() (Last Haunted Gold Mine)
5.GetEnumUnit() - (Picked unit)
6.GetFilterUnit() - (Matching unit)
7.GetAttackedUnitBJ()/GetAttackedUnit() - (Attacked unit)
8.GetAttacker() - (Attacking unit)
9.GetBuyingUnit() - (Buying unit)
10.GetCancelledStructure() - (Cancelled structure)
11.GetSpellAbilityUnit() - (Casting unit)
12.GetConstructingStructure() - (Constructing structure)
13.GetConstructedStructure() - (Constructed structure)
14.GetEventDamageSource() - (Damage source)
15.GetDecayingUnit() - (Decaying unit)
16.GetDyingUnit() - (Dying unit)
17.GetEnteringUnit() - (Entering unit)
18.GetManipulatingUnit() - (Hero manipulating item)
19.GetKillingUnitBJ()/GetKillingUnit() - (Killing unit)
20.GetLearningUnit() - (Learning Hero)
21.GetLeavingUnit() - (Leaving unit)
22.GetLevelingUnit() - (Leveling Hero)
23.GetLoadedUnitBJ()/GetLoadedUnit() - (Loading unit)
24.GetOrderedUnit() - (Ordered unit)
25.GetChangingUnit() - (Ownership-changed unit)
26.GetResearchingUnit() - (Researching unit)
27.GetRevivableUnit() - (Revivable Hero)
28.GetRevivingUnit() - (Reviving Hero)
29.GetSellingUnit() - (Selling unit)
29.GetSoldUnit() - (Sold unit)
29.GetSummonedUnit() - (Summoned unit)
29.GetSummoningUnit() - (Summoning unit)
29.GetOrderTargetUnit() - (Target unit of issued order)
29.GetSpellTargetUnit() - (Target unit of ability being cast)
29.GetEventTargetUnit() - (Targeted unit)
29.GetTrainedUnit() - (Trained unit)
29.GetTransportUnitBJ()/GetTransportUnit() - (Transporting unit)
29.GetTriggerUnit() - (Triggering unit)
Code:
This system was made by Uareanoob.
Small math help from Pyrogasm.
Change Log: v1.01
1. Changed All "Casting Units" To "Triggering Unit".
2.Changed "MUI New Units" Event to "Unit - A unit enters (Playable map area)"
3.Also removed unit group from "MUI New Units".
Change Log: v1.02
1.Re-Made Test Spell
________________________
Check Out my MUI System for GUI