• 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.

[Trigger] Collision spell problem. Need help/working system.

Status
Not open for further replies.
Level 13
Joined
Jun 5, 2008
Messages
504
First trigger
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Blast
  • Actions
    • Set Fireball_point[1] = ((Position of (Triggering unit)) offset by 100.00 towards ((Facing of (Triggering unit)) - 20.00) degrees)
    • Set Fireball_point[2] = ((Position of (Triggering unit)) offset by 1000.00 towards (Facing of (Triggering unit)) degrees)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Unique_number Less than 1000
      • Then - Actions
        • Set Unique_number = (Unique_number + 1)
      • Else - Actions
        • Set Unique_number = 1
    • Unit - Create 1 Fireball for (Triggering player) at Fireball_point[1] facing Default building facing degrees
    • Unit - Order (Last created unit) to Move To Fireball_point[2]
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Unit - Set the custom value of (Last created unit) to Unique_number
    • Unit Group - Add (Last created unit) to Fireball_group
    • Custom script: call RemoveLocation(udg_Fireball_point[1])
    • Custom script: call RemoveLocation(udg_Fireball_point[2])
  • 2nd: trigger
  • Events
    • Time - Every 0.10 seconds of game time
  • Actions
    • For each (Integer A) from 1 to (Number of units in Fireball_group), do (Actions)
      • Loop - Actions
        • Unit Group - Pick every unit in (Random 1 units from Fireball_group) and do (Actions)
          • Loop - Actions
            • Set FireballInt = (Custom value of (Picked unit))
            • Set Fireball_point[FireballInt] = (Position of (Picked unit))
            • Set Fireball_unit[FireballInt] = (Picked unit)
            • Unit Group - Pick every unit in (Units within 150.00 of Fireball_point[FireballInt] matching (((Matching unit) belongs to an enemy of (Owner of Fireball_unit[FireballInt])) Equal to True)) and do (Actions)
              • Loop - Actions
                • Set fireballgroup2 = (Last created unit group)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Number of units in fireballgroup2) Greater than 0
                  • Then - Actions
                    • Special Effect - Create a special effect at Fireball_point[FireballInt] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
                    • Special Effect - Destroy (Last created special effect)
                    • Unit - Cause Fireball_unit[FireballInt] to damage (Picked unit), dealing 250.00 damage of attack type Spells and damage type Normal
                    • Unit - Explode Fireball_unit[FireballInt]
                    • Unit Group - Remove Fireball_unit[FireballInt] from Fireball_group
                  • Else - Actions
            • Set Fireball_unit[FireballInt] = No unit
            • Custom script: call DestroyGroup(udg_fireballgroup2)
            • Custom script: call RemoveLocation(udg_Fireball_point[udg_FireballInt])

Iv tried many freaking things and cant get this working properly. The explosion sometimes exlodes too early/possition where it shouldnt explode (i mean the special effect).

Why im trying to do this with periodic? because If i do it with unit comes withing range. I think it would cause lagg at some point of the game when creating too many events.

And i know polar offset leaks twice, but ill fix it later.

Can someone help with this? I would also apriciate if someone could figure out how to make good collision system with gui or with jass/gui combination.
 
Level 13
Joined
Jun 5, 2008
Messages
504
Well, i just showed you how a system works, adopt my technique and make it MUI, your way was just wrong, how you enumed all the units and such. Take my spell, take the collision system of it and work around with it.

Well i would apriciate if you would tell me why my style is so wrong. I know its wrong cause it doesnt work properly, but Im not sure would your style be any better for mui/mpi.
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Well, your style is simply leaky and does not right work, you pick a group and set then a var to last created unit group? no sense behind. DO it like i do and you will be fine.

You need to assign the unit group directly like in my big bang kamehameha spell map.

Your style is simply bugged and senseless, nothing about MPI or MUI.
 
Level 13
Joined
Jun 5, 2008
Messages
504
Well, your style is simply leaky and does not right work, you pick a group and set then a var to last created unit group? no sense behind. DO it like i do and you will be fine.

You need to assign the unit group directly like in my big bang kamehameha spell map.

Your style is simply bugged and senseless, nothing about MPI or MUI.

I do not think my style is wrong. I modified my triggers a bit after i found out the problem that was it also picked units that were dead. So adding few more conditions this trigger will work. Thanks anyway, I think i got leakless/mui collision system now.
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Thing is, people who do not have enough experience, try to create something big.
You(kewlthis) have issues creating simpler triggers - this is easily deducted by all the mistakes you made(destroying a global group, on a very unsuitable place).
To sum up - you lack logic(you need more experience creating correctly working triggers to obtain more).
Until you do, use other people's systems and triggers(I do not by any way suggest you to steal triggers from other maps), learn from them, create stuff and check if it is done correctly(by asking someone for an evaluation).
P.s. You yourself asked for a working one in the thread tittle.
 
Level 13
Joined
Jun 5, 2008
Messages
504
Thing is, people who do not have enough experience, try to create something big.
You(kewlthis) have issues creating simpler triggers - this is easily deducted by all the mistakes you made(destroying a global group, on a very unsuitable place).
To sum up - you lack logic(you need more experience creating correctly working triggers to obtain more).
Until you do, use other people's systems and triggers(I do not by any way suggest you to steal triggers from other maps), learn from them, create stuff and check if it is done correctly(by asking someone for an evaluation).
P.s. You yourself asked for a working one in the thread tittle.

Well That aint hardly ready trigger, but i was just trtying to find the problem by using differend things. When i find the problem I can start making the trigger cleaner. As for redscores spell aint even mui or mpi so i didnt see anything worth trying from that. I think I can make it good enough with my system. If not, then its my problem.
 
Status
Not open for further replies.
Top