HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Fear Spell

10-29-2005, 05:40 PM#1
Soultaker
Hi all! I would like to create a Fear spell so for a xxx period a targeted unit will flee for xx seconds in the other direction with a random degree to the sides of like -45 to +45. It should be dispelable, but I will think about that later :P

So... I have tried making it, but it can't really make a good trigger, so instead of posting my own trigger, I would like to see some of your examples.

Later on I will make it more clean, maybe AoE and some other stuff, I'm just asking for the General Idea :D

-Soultaker
10-29-2005, 09:54 PM#2
harel
I created a fear spell from silence. Check at the attacks prevented check all the options (melee, renged, special and spells), the enemy units will flee if you will attack them.
Code:
Fear
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fear
    Actions
Set FearPoint = (Target point of ability being cast)
Set FearGroup = (Units within 600.00 of FearPoint matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))))
Point - Remove FearPoint
        Unit Group - Pick every unit in FearGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Picked unit))
                Set TempPoint1 = (TempPoint offset by 1200.00 towards (Random angle) degrees)
                Unit - Order (Picked unit) to Move To TempPoint1
                Point - Remove TempPoint
                Point - Remove TempPoint1
        Unit Group - Remove all units from FearGroup
10-29-2005, 11:32 PM#3
Soultaker
Quote:
Originally Posted by harel
I created a fear spell from silence. Check at the attacks prevented check all the options (melee, renged, special and spells), the enemy units will flee if you will attack them.
Code:
Fear
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fear
    Actions
Set FearPoint = (Target point of ability being cast)
Set FearGroup = (Units within 600.00 of FearPoint matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))))
Point - Remove FearPoint
        Unit Group - Pick every unit in FearGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Picked unit))
                Set TempPoint1 = (TempPoint offset by 1200.00 towards (Random angle) degrees)
                Unit - Order (Picked unit) to Move To TempPoint1
                Point - Remove TempPoint
                Point - Remove TempPoint1
        Unit Group - Remove all units from FearGroup

Nice, must say that I would never had thought of Silence.

But, there is one other ting...

If the Temp1 Point is on top of a cliff or into the water or something like that, the unit will run some weird ways trying to get up there. Do you know how to fix that?

-Soultaker
10-30-2005, 12:29 AM#4
harel
Quote:
If the Temp1 Point is on top of a cliff or into the water or something like that, the unit will run some weird ways trying to get up there. Do you know how to fix that?
I'm not sure but the only logical thing i could think about is:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
            (Terrain cliff level at TempPoint1) Equal to (Terrain cliff level at TempPoint1)
            Then - Actions
         Unit - Order (Picked unit) to Move To TempPoint1
    Else - Actions
         Do nothing
There is an integer pathing comparison but i dont know how to use it.
I don't know how to set the distance to mach the same cliff level.
Sorry
10-30-2005, 06:49 AM#5
Soultaker
Quote:
Originally Posted by harel
Quote:
If the Temp1 Point is on top of a cliff or into the water or something like that, the unit will run some weird ways trying to get up there. Do you know how to fix that?
I'm not sure but the only logical thing i could think about is:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
            (Terrain cliff level at TempPoint1) Equal to (Terrain cliff level at TempPoint1)
            Then - Actions
         Unit - Order (Picked unit) to Move To TempPoint1
    Else - Actions
         Do nothing
There is an integer pathing comparison but i dont know how to use it.
I don't know how to set the distance to mach the same cliff level.
Sorry

It's fine :) Ã? think that will do. Just add the movement thing in the else box and it should work :P

Really hope it works ;D

-Soultaker
10-30-2005, 07:38 AM#6
harel
I accidently wrote
Code:
(Terrain cliff level at TempPoint1) Equal to (Terrain cliff level at TempPoint1)
and i ment
Code:
(Terrain cliff level at TempPoint) Equal to (Terrain cliff level at TempPoint1)

Sorry i wrote this at 3am
10-30-2005, 08:42 AM#7
Soultaker
Quote:
Originally Posted by harel
I accidently wrote
Code:
(Terrain cliff level at TempPoint1) Equal to (Terrain cliff level at TempPoint1)
and i ment
Code:
(Terrain cliff level at TempPoint) Equal to (Terrain cliff level at TempPoint1)

Sorry i wrote this at 3am

It works flawless at a completely flat map, and it detects if there is a cliff behind the unit, but I don't know what to do then, because then I would have to make the unit run the other way which I don't want. :)

-Soultaker
10-30-2005, 09:23 AM#8
Soultaker
Quote:
Originally Posted by harel
I accidently wrote
Code:
(Terrain cliff level at TempPoint1) Equal to (Terrain cliff level at TempPoint1)
and i ment
Code:
(Terrain cliff level at TempPoint) Equal to (Terrain cliff level at TempPoint1)

Sorry i wrote this at 3am

It works flawless at a completely flat map, and it detects if there is a cliff behind the unit, but I don't know what to do then, because then I would have to make the unit run the other way which I don't want. :)

-Soultaker
10-31-2005, 08:30 AM#9
harel
Here is a slightly different version every 2 second (or what ever you like the unit move to a different point (like thy don't know what to do...).
I hope you will like this version.
Code:
Fear
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fear
    Actions
Set FearPoint = (Target point of ability being cast)
Set FearGroup = (Units within 600.00 of FearPoint matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))))
Point - Remove FearPoint
Trigger - Turn on Move Enemies <gen>
Countdown Timer - Start FearCounter as a One-shot timer that will expire in 15.00 seconds
The trigger Move Enemies is initially off
Code:
Move Enemies
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
Unit Group - Pick every unit in FearGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Picked unit))
                Set TempPoint1 = (TempPoint offset by 400.00 towards (Random angle) degrees)
                Point - Remove TempPoint
                Unit - Order (Picked unit) to Move To TempPoint1
                Point - Remove TempPoint1
Code:
Fear end
    Events
        Time - FearCounter expires
    Conditions
    Actions
        Trigger - Turn off Move Enemies <gen>
        Point - Remove TempPoint
        Point - Remove TempPoint1
        Unit Group - Remove all units from FearGroup
10-31-2005, 07:04 PM#10
Soultaker
Quote:
Originally Posted by harel
Here is a slightly different version every 2 second (or what ever you like the unit move to a different point (like thy don't know what to do...).
I hope you will like this version.
Code:
Fear
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fear
    Actions
Set FearPoint = (Target point of ability being cast)
Set FearGroup = (Units within 600.00 of FearPoint matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is A ground unit) Equal to True) and (((Matching unit) is alive) Equal to True))))
Point - Remove FearPoint
Trigger - Turn on Move Enemies <gen>
Countdown Timer - Start FearCounter as a One-shot timer that will expire in 15.00 seconds
The trigger Move Enemies is initially off
Code:
Move Enemies
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
Unit Group - Pick every unit in FearGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Picked unit))
                Set TempPoint1 = (TempPoint offset by 400.00 towards (Random angle) degrees)
                Point - Remove TempPoint
                Unit - Order (Picked unit) to Move To TempPoint1
                Point - Remove TempPoint1
Code:
Fear end
    Events
        Time - FearCounter expires
    Conditions
    Actions
        Trigger - Turn off Move Enemies <gen>
        Point - Remove TempPoint
        Point - Remove TempPoint1
        Unit Group - Remove all units from FearGroup

I will look into it, thank you! :)

-Soultaker
11-04-2005, 07:21 AM#11
Soultaker
After I editet it a bit it worked for Multiplayer too, thanks a lot!

How do I give you rep? :)

-Soultaer
11-05-2005, 12:27 AM#12
LegolasArcher
The reputation system was removed with the rewrite. Theres a lot that needs to be done before it aswell.