• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Math Problem

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
I still don't get it why but my AoE of a custum spell won't work properly.
It has 5 levels, and the AoE starts at 300, then 400, then 500 etc
So in normal math you would get the formula: 200 + 100x = y

But it wont work here... The below trigger makes AoE that are way to big.
But when I try 100 + 50x = y they become to small.... (Half)

So what do I need to do in the below trigger to get the correct formula?

  • Unit Group - Pick every unit in (Units within (200.00 + (100.00 x (Real((Level of Excorcism [E] for (Triggering unit)))))) of CastPoint[(Player number of (Owner of (Triggering unit)))]) and do (Actions)
    • Loop - Actions
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
so u want it to have a radius of 300, right? that means it is a 600 area as far as i know

this leaks, too

better make a unit group using

Set AOEGroup = Every unit within (200 + ((Level of Ability for unit) x 100) range of Point

and remove it later with cal DestroyGroup(udg_AOEGroup)

I just use a bj function to destroy the group. But isn't your formula the same as mine?
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
(taschenrechner?) ????? I'll post the entire trigger. [Oh a calculator, yeh I know normal math. 200 + 100x = y should also work but it doesn't]

  • Excorcism
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Excorcism [E]
    • Actions
      • Set CastPoint[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within (300.00 + (((Real((Level of Excorcism [E] for (Triggering unit)))) - 1.00) x 100.00)) of CastPoint[(Player number of (Owner of (Triggering unit)))]) 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)) is Undead) Equal to True
            • Then - Actions
              • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at CastPoint[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
              • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Exorcism to (Last created unit)
              • Unit - Set level of Exorcism for (Last created unit) to (Level of Excorcism [E] for (Triggering unit))
              • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_CastPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
Now lvl1 Channel has a targeting image of 300 AoE, lvl2 400 AoE.
This Channel ability is called Excorcism [E], it will trigger the dummy to cast; Excorcism on the level of the triggering unit. blabla....

Why does it pick a to big AoE? xD I want this one to be done before I make more....
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
This:
  • Set CastPoint[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
Was still from my previous custom spell trigger and I forgot to edit it.
When I read my trigger I suddenly realized that.
I changed it into:

  • Set CastPoint[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
And now it work's fine. ^^
 
Status
Not open for further replies.
Top