Never Works

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
JASS:
      exitwhen i == DUMMYAMOUNT + 1

Shouldn't that simply be == DUMMYAMOUNT, since you start with i == 0?

Also there is a bj_PI which seems kind of easier to write than just some utterly useless extra long value for pi (3.1415926535 or whatever).

> Can you just fast tell me how to implent it?

Copy the code inside a trigger, done. Gogo scopes and libraries.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
No, if I say

exitwhen i == DUMMYAMOUNT

and DUMMYAMOUNT = 30
Then I would only get 29 dummies, because by the-

Wait-
Oh, shet..

Yea, you're right!
JASS:
exitwhen i == DUMMYAMOUNT //This is correct



Thanks for spotting that
 

Chaos_Knight

New Member
Reaction score
39
I have created a monster =/

I typed all that so that you would look through and ask what certain things did, not ask for a way to implement them without learning =(

Just create a new trigger and convert it to custom text.
Delete everything in the trigger and copy + paste this whole code in.

Then, modify the "private constant" values you see over there.
Do make the effort to look at the code and see if anything is wrong =/

I dont know vJASS so, i think i wouldnt know anyway.

Sine, where do you set the variable "caster" and "playcast"
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
It's already been set as GetTriggerUnit() and GetTriggerPlayer()

Inside the CrushWaveAct function


Also:

nonononononono,
All this is not hard.

JASS:
globals
//Anything in between this block is like a normal Global variable.
//Remember when you use GUI and you have to use this Variable editor window to create new variables?
//This is just like that, except JASS-ified, lol
endglobals


Also, most of it is just a little computer calculation in case you decide 30 dummies is too many or too little, or 100.00 pixels from the caster is too much, or maybe the ID for the spell or unit has changed, etc.

Ignore the math and just read and process it one step at a time =)

JASS:
scope SecurityGuard
//scopes are like security guards
//They limit the access that things outside the scope have
//Sorta' just like, preventing, someone from going in and changing the values or variables
//Anything within the scope is safe as long as you tag it with the word 'private'
//Like private function, for example

endscope

scope StartingOfMap initializer FirstFunction
//initializers are for stuff, like, you know how GUI has this event called "Map Initialization" ?
//initializer will ensure that the function "FirstFunction" will be amongst the first to be run
//Sorta' like a VIP pass to a place

private function FirstFunction takes nothing returns nothing
   //This here will be run before any other function that does not have an initializer =)
endfunction

endscope

//Also, I'm not sure, I think you can have 2 functions with the same name as long as they're in different scopes..
//Never bothered to try it, though

scope ONE

   private function SAME takes nothing returns nothing
   
   endfunction
endscope

scope TWO

   private function SAME takes nothing returns nothing
      //Like so
   endfunction
endscope
 

Chaos_Knight

New Member
Reaction score
39
It's just ONE error.

[LJASS] call TriggerAddAction(t, (1))[/LJASS]

Is error: Cannot convert integer to code

How to fix?
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Why do you have

CrushWaveAct turned into (1) ? o.0

Also, this is why:

JASS:
call TriggerAddAction(t, function CrushWaveAct) //This should fix it


I forgot to add in 'function'
 

Chaos_Knight

New Member
Reaction score
39
SoneCosine, i dont wanna freak your mind out, but the dummies is created but they doesnt cast the spell.

Dont get angry at me. I dont know what i did.

JASS:
scope AwesomeTsunamiOfFreakinDeath initializer CrushWaveInit
   
   globals
      private constant integer SpellID = 'A000'
      private constant integer SHOCKWAVEID = 'A001'
      private constant integer DummyID = 'u000'
      private constant integer DUMMYAMOUNT = 36
      private constant real DISTANCEFROMCASTER = 75.00
   endglobals


   
   private function CrushWaveAct takes nothing returns nothing
      local integer i = 0
      local unit caster = GetTriggerUnit()
      local real rad = GetUnitFacing(caster) * bj_DEGTORAD
      local player playcast = GetTriggerPlayer()
      local unit dummy
      local real radIncrease = ((3.14159265)*2) / DUMMYAMOUNT

      local real DummyX = GetUnitX(caster) + (DISTANCEFROMCASTER) * Cos(rad)
      local real DummyY = GetUnitY(caster) + (DISTANCEFROMCASTER) * Sin(rad)

      loop
      exitwhen i == DUMMYAMOUNT
         set dummy = CreateUnit(playcast, DummyID, DummyX, DummyY, (rad) * bj_RADTODEG)
         call UnitAddAbility(dummy, SHOCKWAVEID)
         call IssuePointOrder(dummy, "shockwave", GetUnitX(caster) + (DISTANCEFROMCASTER+100) * Cos(rad), GetUnitY(caster) + (DISTANCEFROMCASTER+100) * Sin(rad))
         call UnitApplyTimedLife(dummy, 'BTLF', 0.20)
         set dummy = null
      
         set rad = rad + radIncrease
         set DummyX = GetUnitX(caster) + (DISTANCEFROMCASTER) * Cos(rad)
         set DummyY = GetUnitY(caster) + (DISTANCEFROMCASTER) * Sin(rad)
      set i = i+1
      endloop
   endfunction




   private function CrushWaveCond takes nothing returns boolean
      return GetSpellAbilityId() == SpellID
   endfunction

   private function CrushWaveInit takes nothing returns nothing
      local trigger t = CreateTrigger()
      local integer i = 0

      loop
      exitwhen i == 12
         call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
      set i = i+1
      endloop

      call TriggerAddCondition(t, Condition(function CrushWaveCond))
      call TriggerAddAction(t, function CrushWaveAct)
   endfunction

endscope
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
You have to modify this [lJASS]private constant integer SHOCKWAVEID = 'A001'[/lJASS] to the ID of your shockwave
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Maybe it is your dummy unit, also your Expiration timer is too short, this might be the cause, set it to 1second.

Does your spell cost any mana?
Set the manacost to zero.
Set your spell's cast range to 999999, just in case

Many reasons, not sure which is the one, though

Also, your baseID for the spell 'A001' has to be "shockwave" nothing else
 

Chaos_Knight

New Member
Reaction score
39
Maybe it is your dummy unit, also your Expiration timer is too short, this might be the cause, set it to 1second.

Does your spell cost any mana?
Set the manacost to zero.
Set your spell's cast range to 999999, just in case

Many reasons, not sure which is the one, though

Also, your baseID for the spell 'A001' has to be "shockwave" nothing else

Checking everything.



EDIT: THANKS GOD!! GO TO HELL EXPIRIATION TIMER!!

SINE I LOVE YOU!!!

I cannot give rep :(
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Chill, rep isn't everything, you know?
Er, don't get rid of the expiration timer, set it to 1.00seconds or sth like that
 

Chaos_Knight

New Member
Reaction score
39
Chill, rep isn't everything, you know?
Er, don't get rid of the expiration timer, set it to 1.00seconds or sth like that

Ya, i did set it to 1 sec I just said that because i got happy, and angry at that damn Expiration timer. Thanks. "Solved"
 
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