• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Arrow impact system (gui)

Status
Not open for further replies.
Level 4
Joined
Jun 19, 2010
Messages
112
I currently working on single player RPG, and... here is simple system that I created for map.
at the moment it s very-veeeeery simple, but anyway looks cool ingame

i have only rus WE, so you may not understand half of trigger text. sorry for that.
added comments (marked as //comment) hope it gonna help u.
  • impact
    • События
      • Боевая единица - A unit Атакован
      • // event starts when any unit gets attacked
    • Условия
      • (Attacking unit) равно Raider 0002 <gen>
      • //unit type check - is unit get attacked by bow, or not//
    • Действия
      • Триггер - Turn on skip <gen>
      • //skip trigger very important. gonna show him later
      • Set skip = Нет
      • Set RANDOM = (Random integer number between 0 and 4)
      • Set distance = (Distance between (Position of (Attacked unit)) and (Position of (Attacking unit)))
      • Wait (0.40 + (distance / 4000.00)) seconds
      • //wait synhronize trigger with flying arrow. number 4000 depends on missle speed. (4000 good for 2500)
      • If (skip равно Да) then do (Skip remaining actions) else do (Do nothing)
      • //about this - later
      • Set currentattackedUNIT = (Attacked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Если - Условия
          • (Ability being cast) равно power shot (враг)
        • РўРѕ - Действия
          • Р˜РіСЂР° - Display to (All players) the text: (String(distance))
        • Р˜РЅР°С‡Рµ - Действия
        • //well, arrow can also impact when hero cast a spell\uses item and so on. to prevent this i do this: if ability been cast = ***, then skip remaning action (for each ability avaible for hero)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Если - Условия
              • ((Facing of currentattackedUNIT) меньше или равно ((Facing of Raider 0002 <gen>) + 100.00)) and ((Facing of currentattackedUNIT) больше или равно ((Facing of Raider 0002 <gen>) - 100.00))
            • //you also can shoot enemies from behind. this condition check facing angle, and creates arrow on...pfffff... back of units.
            • РўРѕ - Действия
              • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
              • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACTbehind.mdx
              • Skip remaining actions
            • Р˜РЅР°С‡Рµ - Действия
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Если - Условия
              • RANDOM меньше или равно 1
            • РўРѕ - Действия
              • //and finally arrows and blood splashes. i have 5 different arrow models (positions), 4 for..... god damnit. for fa... for NOT BEHIND, and 1 for behind.
              • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT1.mdx
              • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
            • Р˜РЅР°С‡Рµ - Действия
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Если - Условия
                  • RANDOM равно 2
                • РўРѕ - Действия
                  • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Other\HumanBloodCinematicEffect\HumanBloodCinematicEffect.mdl
                  • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                  • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT2.mdx
                • Р˜РЅР°С‡Рµ - Действия
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Если - Условия
                      • RANDOM равно 3
                    • РўРѕ - Действия
                      • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT3.mdx
                    • Р˜РЅР°С‡Рµ - Действия
                      • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT4.mdx
  • skip
    • События
      • Боевая единица - Raider 0002 <gen> Отдал приказ (цель - объект)
      • Боевая единица - Raider 0002 <gen> Отдал приказ (цель - точка)
      • Боевая единица - Raider 0002 <gen> Отдал приказ (без указания цели)
    • Условия
    • Действия
      • Триггер - Turn off (This trigger)
      • Set skip = Да
emmm.... the point is .... ok, look.
unit attack another unit.
event "unit get attacked" runs exactly in moment, when attack animation start playing. (i mean it run before unit get damage, or arrow of attacking unit release)
so.
you can give order to attack enemy, your unit start aiming (trigger runs) and.. you push S button. unit canceled attack, but trigger create arrow on attacked unit anyway.
this is the point. when unit take another order while he fighting, trigger will turn special variable on, and main trigger gonna stop after "wait" action

ffhhhhhhh i finished
believe me, write this is mooooar difficult that read

ok, and finally ingame screenshot
192610-albums3546-picture32687.jpg
 
Last edited:
This detects damage, which ALWAYS occurs AFTER your attacks/spells.
  • Damage
  • Events
  • Unit - A unit enters (Playable map area)
  • Conditions
  • Actions
  • Trigger - Add to DamageHeal <gen> the event (Unit - (Triggering unit) Takes damage)
  • DamageHeal
  • Events
  • Conditions
  • //Just make sure the Damage Source is your bowman
  • Actions
And so, paste your actions and conditions into DamageHeal.
 
A unit enters (Playable Map Area)-so when a unit is created, trained, summoned, whatever, it will be known as 'Triggering Unit'.
Trigger - Add to DamageHeal <gen> the event (Unit - (Triggering unit) Takes damage)-Adds the event to DamageHeal so that when 'Triggering Unit', which should be any unit ever to appear on the map, takes damage, it fires the trigger.

Триггер - Turn on skip <gen>
//skip trigger very important. gonna show him later
Set skip = Нет
Set RANDOM = (Random integer number between 0 and 4)
Set distance = (Distance between (Position of (Attacked unit)) and (Position of (Attacking unit)))
Wait (0.40 + (distance / 4000.00)) seconds
//wait synhronize trigger with flying arrow. number 4000 depends on missle speed. (4000 good for 2500)
If (skip равно Да) then do (Skip remaining actions) else do (Do nothing)
//about this - later
Set currentattackedUNIT = (Attacked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Если - Условия
(Ability being cast) равно power shot (враг)
То - Действия
Р˜РіСЂР° - Display to (All players) the text: (String(distance))
Р˜РЅР°С‡Рµ - Действия
//well, arrow can also impact when hero cast a spell\uses item and so on. to prevent this i do this: if ability been cast = ***, then skip remaning action (for each ability avaible for hero)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Если - Условия
((Facing of currentattackedUNIT) меньше или равно ((Facing of Raider 0002 <gen>) + 100.00)) and ((Facing of currentattackedUNIT) больше или равно ((Facing of Raider 0002 <gen>) - 100.00))
//you also can shoot enemies from behind. this condition check facing angle, and creates arrow on...pfffff... back of units.
То - Действия
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACTbehind.mdx
Skip remaining actions
Р˜РЅР°С‡Рµ - Действия
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Если - Условия
RANDOM меньше или равно 1
То - Действия
//and finally arrows and blood splashes. i have 5 different arrow models (positions), 4 for..... god damnit. for fa... for NOT BEHIND, and 1 for behind.
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT1.mdx
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Р˜РЅР°С‡Рµ - Действия
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Если - Условия
RANDOM равно 2
То - Действия
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Other\HumanBloodCinematicEffect\HumanBloodCinematicEffect.mdl
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT2.mdx
Р˜РЅР°С‡Рµ - Действия
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Если - Условия
RANDOM равно 3
То - Действия
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using war3mapImported\IMPACT3.mdx
Р˜РЅР°С‡Рµ - Действия
Спецэффект - Create a special effect attached to the chest of currentattackedUNIT using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl

Then copy and paste this into 'DamageHeal'.
 
GhostThruster, thanks a lot! i didn't knew anything about this command before.
this is realy useful, and will make system more simple. gonna try it right now.

Zanekok, thank you.
yes it will, but i can remake it for multi-player maps.
hmmm... one simple action gonna remove all lags

if, then, blablabla
special effect: create arrow
special effect: destroy last created spec effect


arrow will decay 4-5 seconds, and then disappear
(in my map hero just can't shoot as many arrows as needed to lag computer)
 
it doesn't work.
dunno, may be i did something wrong.

here is 2 trigger like you say:

1
event: unit - unit enters (playable map area)
conditions: nothing
actions: trigger - add to <trigger 2> the event (unit - triggering unit recieve damage)


2
event: nothing
conditions: damage source is my hero
actions:
not matter, thay just not work

i think, problem is here: event: unit - unit enters (playable map area)
how can it affect all units in map? i though, this is event for single units

then i do this:
1
event: unit - unit enters (playable map area)
conditions: none
actions: set "variable" = triggering unit
show text - variable converted to string "variable"


aaaand nothing happens.
what i do wrong?

---------------------

ok, i make it work.

  • start
    • event�
      • unit - A unit Ð�under attack½
    • conditions¸Ñ�
      • some useless for ya stuff
    • actionsÑ�
      • Set currentattackedUNIT = (Attacked unit)
      • trigger add the action to <impact> "currentattackedUNIT recieve damage"
  • impact
    • actions�
      • nothing
    • conditions
      • (Damage source) is Raider 0002 <gen>
    • actions
      • actions, that create spec effectes
looks cool, no wait, no massive code
only one thing I'm worried:
  • trigger add the action to <impact> "currentattackedUNIT recieve damage"
it will add action every time any unit get attacked.
will it spawn endlessly, and cause lag?
 
Last edited:
ah, no. i mean this:

at begining trigger looks like this:
trigger
event
condition
action
<spawn effects>

later

trigger
event
unit recieve damage
condition
action
<spawn effects>

later

trigger
event
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
unit recieve damage
condition
action
<spawn effects>

and so on
i mean, every time unit attacked, trigger creates new event.
or it's not?
 
Status
Not open for further replies.
Back
Top