Spell Lightning Anger

PurgeandFire

zxcvmkgdfg
Reaction score
509
I guess it might be faster, but in my opinion it isn't really too necessary to declare a local. The speed difference (if any) is so minimal, but I guess that is better primarily for organization.
 

quraji

zap
Reaction score
144
Some stuff that can help it do less multiplication:
JASS:
local real real1                   = GetUnitFacing(GetTriggerUnit())*bj_DEGTORAD

local real x2 = x + 300 * Cos(real1 + 2.531)
local real y2 = y + 300 * Sin(real1 + 2.531)

local real x3 = x + 300 * Cos(real1 + 3.142)
local real y3 = y + 300 * Sin(real1 + 3.142)

local real x4 = x + 300 * Cos(real1 + 3.752)
local real y4 = y + 300 * Sin(real1 + 3.752)


Because it is doing the radians of the facing + the radians of the numbers you have. A little less math for the machine. :p

A little less math for the machine:
JASS:

local real real1 = GetUnitFacing(GetTriggerUnit())* .017453
local real newx = x + 300
local real newy = y + 300

local real x2 = newx * Cos(real1 + 2.531)
local real y2 = newy * Sin(real1 + 2.531)

local real x3 = newx * Cos(real1 + 3.142)
local real y3 = newy * Sin(real1 + 3.142)

local real x4 = newx * Cos(real1 + 3.752)
local real y4 = newy * Sin(real1 + 3.752)


Just to be an ass I guess...mwahahahaha.

Oh, and cool looking spell, good job :)
 

Flare

Stops copies me!
Reaction score
662
JASS:
local real newx = x + 300
local real newy = y + 300

local real x2 = newx * Cos(real1 + 2.531)
local real y2 = newy * Sin(real1 + 2.531)


Would that even work???
If you take the initial X value to be 10, and the result of the Cos to be 0.5 (for example)

10 + 300 = 310
310 * 0.5 = 155
BUT
10 + 300*0.5 = 10 + 150
10 + 150 = 160

the result is out a bit (would be worse if the x (or y) value was much greater)

Example 2 (with a bigger number!)

init X: 100
Cos (val) = 0.5 again

100 + 300 = 400
400*0.5 = 200
BUT
100 + 300*0.5 = 100 + 150
100 + 150 = 250

your out 50 on the X in that example, going by ur calculations

and if the original X/Y was a number >= 1000? that could put ur calculation off by about 500, i think

in the end
A + (B * C) != (A + B) * C
 

quraji

zap
Reaction score
144
You caught me :p
I was just trying to be an ass, not really suggesting an improvement hehe.
But you're absolutely right that it wouldn't work as intended, I think you deserve rep for catching it!
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Channels up elektricity to then send it out in form of a giant electricity ball towards your enemy. The electricity ball will follow the target untill it reaches it's goal. When hit the electricity ball will shock all enemies within range of the target dealing damage.

I think someone can't spell electricity consistently! :p

I think I already left a comment about this spell, from what I remember it was good! (Y)
 

Kazuga

Let the game begin...
Reaction score
110
No not really, you may bump every 24 hours and the spell has been up for around a month or so.
 

Trollvottel

never aging title
Reaction score
262
Channels up elektricity to then send it out in form of a giant electricity ball towards your enemy. The electricity ball will follow the target untill it reaches it's goal. When hit the electricity ball will shock all enemies within range of the target dealing damage.
->...
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Channels up elektricity to then send it out in form of a giant electricity ball towards your enemy. The electricity ball will follow the target untill it reaches it's goal. When hit the electricity ball will shock all enemies within range of the target dealing damage.

I'm pretty sure that's what Troll was clarifying.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Wow. My WE hraphically crashed badly when I opened this :eek:

Thanks!

Naturally, if the author is to fix these spells, they will most probably be approved once again!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top