Making My Meat Hook MUI

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Making My Meat Hook MUI

Post by CrackUps »

Ok I've created a meat hook that will track it's target if you've targetted a unit or just travel normally if you target the ground. What i want to do now is make it MUI but am pretty unsure on how to do this. It is entirely coded with GUI and would preferably like to keep it like that if possible as I wanted to make it into a hook for GUI coders to use. If it's too hard to make MUI in GUI i'm fine with it being in Jass but then it'll be for my own use (not vJass though please). Could somebody please help me with this.

Map and triggers attached.

[Edit] Latest version of the map attached, did a bunch of touch ups including removing leaks may still be some though
Spoiler:

Code: Select all

Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to (==) Meat Hook [GUI] 
    Actions
        Custom script:   local location TempLoc = GetSpellTargetLoc()
        Set Caster = (Triggering unit)
        Set TargetUnit = (Target unit of ability being cast)
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TargetUnit Equal to (==) No unit
            Then - Actions
                Unit - Create 1 Dummy Target for (Owner of Caster) at (TempLoc) facing Default building facing (270.0) degrees
                Set TargetUnit = (Last created unit)
            Else - Actions
        Set Angle = (Angle from (Position of Caster) to (Position of TargetUnit))
        Set DistanceCoveredMax = (((Level of (Ability being cast) for Caster) x 1000) + 0)
        Trigger - Turn on Create <gen>
        Custom script:   call RemoveLocation(TempLoc)
Spoiler:

Code: Select all

Create
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Custom script:   local location TempLoc1 = GetUnitLoc(udg_Caster)
        Custom script:   local location TempLoc2 = GetUnitLoc(udg_Joint[1])
        Custom script:   local location TempLoc3 = GetUnitLoc(udg_TargetUnit)
        Custom script:   local location TempLoc4 = GetUnitLoc(udg_Joint[udg_NumberOfJoints])
        Custom script:   local location TempLoc5
        Custom script:   local location TempLoc6
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in PotentialTargets) Equal to (==) 0
            Then - Actions
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        DistanceCoveredCurrent Greater than or equal to (>=) DistanceCoveredMax
                    Then - Actions
                        Trigger - Turn on Retract <gen>
                        Trigger - Turn off Create <gen>
                    Else - Actions
                         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                NumberOfJoints Equal to (==) 0
                            Then - Actions
                                Unit - Create 1 Joint for (Owner of Caster) at ((TempLoc1) offset by 80.00 towards Angle degrees) facing Angle degrees
                                Set DistanceCoveredCurrent = (DistanceCoveredCurrent + 80)
                                Set NumberOfJoints = (NumberOfJoints + 1)
                                Set Joint[NumberOfJoints] = (Last created unit)
                                Custom script:   call RemoveLocation(TempLoc1)
                            Else - Actions
                                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Unit-type of TargetUnit) Equal to (==) Dummy Target
                                    Then - Actions
                                        Unit - Move Joint[1] instantly to ((TempLoc2) offset by 40.00 towards (Facing of Joint[1]) degrees), facing (Facing of Joint[1]) degrees
                                        Set DistanceCoveredCurrent = (DistanceCoveredCurrent + 40)
                                        Custom script:   call RemoveLocation(TempLoc2)
                                        Custom script:   call RemoveLocation(TempLoc3)
                                    Else - Actions
                                        Unit - Move Joint[1] instantly to ((TempLoc2) offset by 40.00 towards (Angle from (TempLoc2) to (TempLoc3)) degrees), facing (Angle from (TempLoc2) to (TempLoc3)) degrees
                                        Set DistanceCoveredCurrent = (DistanceCoveredCurrent + 40)
                                        Custom script:   call RemoveLocation(TempLoc2)
                                        Custom script:   call RemoveLocation(TempLoc3)
                                Unit - Create 1 Joint for (Owner of Caster) at ((TempLoc1) offset by 40.00 towards (Angle from (TempLoc1) to (TempLoc4)) degrees) facing (TempLoc4)
                                Custom script:   call RemoveLocation(TempLoc1)
                                Custom script:   call RemoveLocation(TempLoc4)
                                Set NumberOfJoints = (NumberOfJoints + 1)
                                Set Joint[NumberOfJoints] = (Last created unit)
                                 Do Multiple ActionsFor each (Integer A) from 2 to NumberOfJoints, do (Actions)
                                    Loop - Actions
                                        Custom script:   set TempLoc5 = GetUnitLoc(udg_Joint[GetForLoopIndexA()])
                                        Custom script:   set TempLoc6 = GetUnitLoc(udg_Joint[( GetForLoopIndexA() - 1 )])
                                        Unit - Move Joint[(Integer A)] instantly to ((TempLoc5) offset by 40.00 towards (Angle from (TempLoc5) to (TempLoc6)) degrees), facing (TempLoc6)
                                        Custom script:   call RemoveLocation(TempLoc5)
                                        Custom script:   call RemoveLocation(TempLoc6)
            Else - Actions
                Set Snagged = True
                Animation - Change Joint[1]'s animation speed to 0.00% of its original speed
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Target belongs to an ally of (Owner of Caster)) Equal to (==) True
                    Then - Actions
                    Else - Actions
                        Unit - Cause Caster to damage Target, dealing ((Real((Level of Meat Hook [GUI]  for Caster))) x 100.00) damage of attack type Normal and damage type Normal
                        Special Effect - Create a special effect attached to the chest of Target using Objects\Spawnmodels\Human\HumanBlood\HeroBloodElfBlood.mdl
                        Special Effect - Destroy (Last created special effect)
                Unit - Turn collision for Target Off
                Trigger - Turn on Retract <gen>
                Trigger - Turn off Create <gen>
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of TargetUnit) Equal to (==) Dummy Target
            Then - Actions
                Set PotentialTargets = (Units within 120.00 of (Position of Joint[1]) matching ((Matching unit) Not equal to (!=) Caster))
                Set Target = (First unit of group PotentialTargets)
            Else - Actions
                Set PotentialTargets = (Units within 120.00 of (Position of Joint[1]) matching ((Matching unit) Equal to (==) TargetUnit))
                Set Target = (First unit of group PotentialTargets)
Spoiler:

Code: Select all

Retract
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Custom script:   local location TempLoc1 = GetUnitLoc(udg_Joint[1])
        Custom script:   local location TempLoc2 = GetUnitLoc(udg_Joint[2])
        Custom script:   local location TempLoc3 = GetUnitLoc(udg_Caster)
        Custom script:   local location TempLoc4 = GetUnitLoc(udg_Joint[udg_NumberOfJoints - 1])
        Custom script:   local location TempLoc5
        Custom script:   local location TempLoc6
        Custom script:   local location TempLoc7
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                NumberOfJoints Equal to (==) 0
            Then - Actions
                Set DistanceCoveredCurrent = 0
                Set Snagged = False
                Unit - Turn collision for Target On
                Custom script:   call DestroyGroup(udg_PotentialTargets)
                Set Target = No unit
                Trigger - Turn off Retract <gen>
            Else - Actions
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Snagged Equal to (==) True
                    Then - Actions
                    Else - Actions
                         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Unit-type of TargetUnit) Equal to (==) Dummy Target
                            Then - Actions
                                Set PotentialTargets = (Units within 120.00 of (Position of Joint[1]) matching ((Matching unit) Not equal to (!=) Caster))
                                Set Target = (First unit of group PotentialTargets)
                            Else - Actions
                                Set PotentialTargets = (Units within 120.00 of (Position of Joint[1]) matching ((Matching unit) Equal to (==) TargetUnit))
                                Set Target = (First unit of group PotentialTargets)
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        NumberOfJoints Greater than (>) 1
                    Then - Actions
                         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in PotentialTargets) Not equal to (!=) 0
                            Then - Actions
                                Set Snagged = True
                                Animation - Change Joint[1]'s animation speed to 0.00% of its original speed
                                Unit - Move Target instantly to ((TempLoc1) offset by 40.00 towards (Facing of Joint[1]) degrees), facing (Facing of Target) degrees
                                Custom script:   call RemoveLocation(TempLoc1)
                            Else - Actions
                        Unit - Move Joint[1] instantly to (TempLoc2), facing Angle degrees
                        Custom script:   call RemoveLocation(TempLoc1)
                        Custom script:   call RemoveLocation(TempLoc2)
                    Else - Actions
                        Unit - Remove Joint[1] from the game
                Unit - Move Joint[NumberOfJoints] instantly to ((TempLoc3) offset by 40.00 towards (Angle from (TempLoc3) to (TempLoc4)) degrees), facing (TempLoc4)
                Custom script:   call RemoveLocation(TempLoc3)
                Custom script:   call RemoveLocation(TempLoc4)
                 Do Multiple ActionsFor each (Integer A) from ((NumberOfJoints - 1) x -1) to -2, do (Actions)
                    Loop - Actions
                        Custom script:   set TempLoc5 = GetUnitLoc(udg_Joint[(GetForLoopIndexA() *-1)])
                        Custom script:   set TempLoc6 = GetUnitLoc(udg_Joint[( ( GetForLoopIndexA() * -1 ) + 1 )])
                        Custom script:   set TempLoc7 = GetUnitLoc(udg_Joint[( ( GetForLoopIndexA() * -1 ) - 1 )])
                        Unit - Move Joint[((Integer A) x -1)] instantly to ((TempLoc6) offset by 40.00 towards (Angle from (TempLoc6) to (TempLoc5)) degrees), facing (TempLoc7)
                        Custom script:   call RemoveLocation(TempLoc5)
                        Custom script:   call RemoveLocation(TempLoc6)
                        Custom script:   call RemoveLocation(TempLoc7)
                Unit - Remove Joint[NumberOfJoints] from the game
                Set NumberOfJoints = (NumberOfJoints - 1)
You do not have the required permissions to view the files attached to this post.
Last edited by CrackUps on August 20th, 2008, 6:13 am, edited 3 times in total.
User avatar
DarkGod
Member
Posts: 61
Joined: October 1st, 2007, 6:36 pm
Title: The Evil One
Location: Greece

Re: Making My Meat Hook MUI

Post by DarkGod »

Yea That's A Hard Thing But I Will Try.
Remember :
I Do Not Promise Anything.
Image
User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Re: Making My Meat Hook MUI

Post by CrackUps »

Cheers :)

Anybody else able to have a look at it?
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Making My Meat Hook MUI

Post by Arabidnun »

I believe I have of what you ask of me.

[blinking]Casting Ability:(Not touched)[/blinking]
Spoiler:
Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Meat Hook [GUI]
Actions
Set Caster = (Casting unit)
Set TargetLoc = (Target point of ability being cast)
Set TargetUnit = (Target unit of ability being cast)
Set Angle = (Angle from (Position of Caster) to TargetLoc)
Set NumberOfJointsMax = ((Level of (Ability being cast) for Caster) x 20)
Trigger - Turn on CreateLoc <gen>
[blinking]
Create Hook: (edited)
[/blinking]
Spoiler:
CreateLoc
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NumberOfJointsCurrent Equal to NumberOfJointsMax
Then - Actions
Trigger - Turn on RetracLoc <gen>
Trigger - Turn off CreateLoc <gen>
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NumberOfJointsCurrent Equal to 0
Then - Actions
Unit - Create 1 Joint for (Owner of Caster) at ((Position of Caster) offset by 80.00 towards (Angle from (Position of Caster) to TargetLoc) degrees) facing Angle degrees
Set NumberOfJointsCurrent = (NumberOfJointsCurrent + 1)
Set Joint[NumberOfJointsCurrent] = (Last created unit)
Else - Actions
Unit - Move Joint[1] instantly to ((Position of Joint[1]) offset by 40.00 towards (Facing of Joint[1]) degrees), facing (Facing of Joint[1]) degrees
Unit - Create 1 Joint for (Owner of Caster) at ((Position of Caster) offset by 40.00 towards (Angle from (Position of Caster) to (Position of Joint[NumberOfJointsCurrent])) degrees) facing (Position of Joint[NumberOfJointsCurrent])
Set NumberOfJointsCurrent = (NumberOfJointsCurrent + 1)
Set Joint[NumberOfJointsCurrent] = (Last created unit)
For each (Integer A) from 2 to NumberOfJointsCurrent, do (Actions)
Loop - Actions
Unit - Move Joint[(Integer A)] instantly to ((Position of Joint[(Integer A)]) offset by 40.00 towards (Angle from (Position of Joint[(Integer A)]) to (Position of Joint[((Integer A) - 1)])) degrees), facing (Position of Joint[((Integer A) - 1)])

(For each (Integer B) from 1 to NumberOfJointsCurrent, do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units within 50.00 of (Position of Joint[(Integer B)])) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Not equal to Joint
(Picked unit) Not equal to Caster
Then - Actions
Game - Display to (All players) the text: ......
Set TargetUnit = (Picked unit)
Trigger - Turn on RetracLoc <gen>
Trigger - Turn off CreateLoc <gen>
Else - Actions

Edited Portion in Red
[blinking]
Retract Hook
[/blinking]
Spoiler:
RetracLoc
Events
Time - Every 0.04 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NumberOfJointsCurrent Equal to 0
Then - Actions
Trigger - Turn off RetracLoc <gen>
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NumberOfJointsCurrent Greater than 1
Then - Actions
Unit - Move Joint[1] instantly to (Position of Joint[2]), facing Angle degrees
Else - Actions
Unit - Remove Joint[1] from the game
Unit - Move Joint[NumberOfJointsCurrent] instantly to ((Position of Caster) offset by 40.00 towards ((Angle from (Position of Caster) to (Position of Joint[(NumberOfJointsCurrent - 1)])) + 0.00) degrees), facing (Position of Joint[(NumberOfJointsCurrent - 1)])
For each (Integer A) from ((NumberOfJointsCurrent - 1) x -1) to -2, do (Actions)
Loop - Actions
Unit - Move Joint[((Integer A) x -1)] instantly to ((Position of Joint[(((Integer A) x -1) + 1)]) offset by 40.00 towards ((Angle from (Position of Joint[(((Integer A) x -1) + 1)]) to (Position of Joint[((Integer A) x -1)])) + 0.00) degrees), facing (Position of Joint[(((Integer A) x -1) - 1)])
Unit - Remove Joint[NumberOfJointsCurrent] from the game
Set NumberOfJointsCurrent = (NumberOfJointsCurrent - 1)
Unit - Move TargetUnit instantly to (Position of Joint[1])

Edited Portion in red:

What i tried to accomplish here, was when a hook was created, it would choose all hooks, and if the hook chosen has a unit nearby, basically hooking them, it would set them to the desired target, and then go on to retracting the hooks. When retracting the hooks, it would move the target which we declared in the creation of the hooks, to the 1st hook ever created, which is the beginning of the chain. Then when all the hooks are gone, the unit is nearby the casting unit ready to be pwnified =D. Heres the map if you would like to see it in action. Please, do not hesitate to ask any more questions.
Meat Hook [GUI] Non-MUI.w3x
You do not have the required permissions to view the files attached to this post.
User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Re: Making My Meat Hook MUI

Post by CrackUps »

The map you've uploaded seems to be the same as the one i did, did you upload wrong one?
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Making My Meat Hook MUI

Post by Arabidnun »

One second, I am checking =D

Edit: Nope, thats the right map, just open it and see for yourself
User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Re: Making My Meat Hook MUI

Post by CrackUps »

I have and there doesn't seem to be anything different and it's still not MUI

[Edit] Oh yup it is different but not what i wanted sorry
Arabidnun
Forum Staff
Posts: 506
Joined: August 5th, 2007, 1:38 pm
Title: Gui Expert
Location: *Unknown*

Re: Making My Meat Hook MUI

Post by Arabidnun »

Did you want this trigger in Jass?

Edit: Oh, you want this trigger to be used by multiple units, I got yah.
User avatar
CrackUps
Member
Posts: 96
Joined: October 6th, 2007, 12:21 am

Re: Making My Meat Hook MUI

Post by CrackUps »

Haha yeah