• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Elim tourny jump

Status
Not open for further replies.
soo do i change this trigger?

  • GUIVariables
    • Events
    • Conditions
    • Actions
      • -------- This trigger is to help you copy all the variables in 1 go, no other use. It can be deteled --------
      • -------- particle system variables --------
      • Set MapSize[1] = 0.00
      • Set clsParticleConditionStrings[1] = (Center of (Playable map area))
      • Set clsParticleConditions[1] = (Center of (Playable map area))
      • Set clsParticleDummyEffect[1] = (Last created special effect)
      • Set clsParticleForces[1] = (Center of (Playable map area))
      • Set clsParticlePlace[1] = 0
      • Set clsParticleSpeed[1] = 0
      • Set clsParticleTaken[1] = False
      • Set clsStringIndexString[1] = <Empty String>
      • Set conditionDeath = (This trigger)
      • Set forceGravity = 0
      • Set conditionGroundHit = (This trigger)
      • Set particleGroup = (Last created unit group)
      • Set particleSpawnOffset = 0
      • Set forceWind = 0
      • -------- vector system variables --------
      • Set vectorMaxIndex = 0
      • Set vectorTaken[1] = False
      • Set vectorUnusedAmount = 0
      • Set vectorUnusedIndex[1] = 0
      • Set vectorX[1] = 0.00
      • Set vectorY[1] = 0.00
      • Set vectorZ[1] = 0.00
 
Jass Help Please!

1. Elimination Tournament Jump Trigger: [solved]


jass would be a way to make this right? ive downloaded the particle system, however, i need a jump trigger ability that will coincide with it. can some one please make me a jump system that works with the particle system with some detailed explanations? [this is solved]

2. Slide trigger with Particle system:


with jass, how can i make a sliding trigger on the "Certain Terrain" where, if the terrain is too steep, then the unit wont be able to go up with out enough speed, and will go faster down steeper terrain. Also if the unit is going fast enough, then it will jump off a hill of the terrain depending on the speed. is this possible? and if so can someone please help and explain how to do this?
 
Last edited:
Level 40
Joined
Dec 14, 2005
Messages
10,532
JASS:
local location l = GetUnitLoc(u)
local real z = GetLocationZ(l)//+GetUnitFlyHeight(u) if you want to add their fly height
call RemoveLocation(l)
set l = null

And Just_Spectating, I'll take a peek today.

EDIT: I was just looking, and isn't this basically what's in the example in the test map?

~Thread moved to Spells&Systems
 
Last edited:
Level 40
Joined
Dec 14, 2005
Messages
10,532
Run the actions of the example when the unit casts the ability...

For example (play with the vals?)

I made it go for 1s (used tsa for conciseness, don't actually use it...), won't necessarily be very accurate or look that great, but you get the idea..

JASS:
function Trig_Test_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'Your Ability Id'
endfunction

function Trig_Test_Actions takes nothing returns nothing
  local unit u = GetTriggerUnit()
  call clsParticleCreate(u)
  call MakeUnitFlyable(u)
  call GroupAddUnit(udg_particleGroup, u)
  call ParticleSetSpeed(u,500,0,2000)
  call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_Bounce")
  call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
  call ParticleAddForce(u, Wind())
  call ParticleAddForce(u, G())
  call TriggerSleepAction(1)
  call clsParticleDestroy(u)
  call GroupRemoveUnit(udg_particleGroup, u)
  set u = null
endfunction

//===========================================================================
function InitTrig_Test takes nothing returns nothing
    set gg_trg_Test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Test, Condition( function Trig_Test_Conditions ) )
    call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
 
Last edited:
Level 20
Joined
Apr 22, 2007
Messages
1,960
He means, do this:

JASS:
function Trig_Test_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'Your Ability Id'
endfunction
function Trig_Test_Actions takes nothing returns nothing
  local unit u = GetTriggerUnit()
  local real r=GetUnitFacing(u)*3.14159/180.
  call clsParticleCreate(u)
  call MakeUnitFlyable(u)
  call GroupAddUnit(udg_particleGroup, u)
  call ParticleSetSpeed(u,Cos(r)*500,Sin(r)*500,2000)
  call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_Bounce")
  call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
  call ParticleAddForce(u, Wind())
  call ParticleAddForce(u, G())
  call TriggerSleepAction(1)
  call clsParticleDestroy(u)
  call GroupRemoveUnit(udg_particleGroup, u)
  set u = null
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
    set gg_trg_Test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Test, Condition( function Trig_Test_Conditions ) )
    call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Remove this line for the unit to not bounce:
JASS:
call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_Bounce")

I once modded this system so that units would stop bouncing once idle. If I could find what I did, I might post it here.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
GAH 1 second.

I'll try to fix this.

EDIT: Okay, add this in the Particle Supplement Functions trigger. Add it at the very bottom:
JASS:
function GroundHit_RemoveParticle takes nothing returns nothing
  local unit u = GetEnumUnit()
  call RemoveParticle(u,false)
endfunction

Now, in your trigger, replace this line:
JASS:
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
By this line:
JASS:
call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_RemoveParticle")
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
It's easy, really. There are speed globals. You just do a periodic check of the speed globals, and once they are all low enough, you just remove the particle effect and set the height of the unit to 0. I did this once, but since I've cleaned my computer I think I've deleted it.
 
Level 10
Joined
Nov 10, 2004
Messages
351
JASS:
function GroundHit_BounceJump takes nothing returns nothing
  local unit u = GetEnumUnit()
  local integer i = GetUnitUserData(u)
  local integer p = udg_clsParticlePlace[i]
  local integer v = udg_clsParticleSpeed[i]
  local integer vector1 = VectorGetTerrainNormal(udg_vectorX, udg_vectorY, 25.0)
  local integer vector2 = VectorProjectVector(v,vector1)
  set udg_vectorX = udg_vectorX - udg_vectorX[v]*ParticlePeriod()
  set udg_vectorY = udg_vectorY - udg_vectorY[v]*ParticlePeriod()
  set udg_vectorZ = udg_vectorZ - udg_vectorZ[v]*ParticlePeriod()
  if IsTerrainPathable(GetUnitX(u),GetUnitY(u), PATHING_TYPE_WALKABILITY) then  
      call PauseUnit(u,false)
      call RemoveParticle(u,false)
endif
  call VectorScale(vector2, -2)
  call VectorAdd(v, vector2)
  call VectorScale(v, 0.90)
  call VectorDestroy(vector1)
  call VectorDestroy(vector2)
  set u = null
endfunction

Replacing "GroundHit_Bounce" with the above function should make it bounce off walls.
 
Level 10
Joined
Nov 10, 2004
Messages
351
Well, there are some other systems on wc3c which does what you asked for.
But i can give you a hint how to make it with the Particle system.

You'll have to check the terrain around the unit, which can be done with the VectorGetTerrainNormal() function. After you have done that, you'll have to increase it's speed toward that direction. I can't show you how to do that right now, but i've done something similar before.
 
JASS:
function GroundHit_BounceJump takes nothing returns nothing
  local unit u = GetEnumUnit()
  local integer i = GetUnitUserData(u)
  local integer p = udg_clsParticlePlace[i]
  local integer v = udg_clsParticleSpeed[i]
  local integer vector1 = VectorGetTerrainNormal(udg_vectorX, udg_vectorY, 25.0)
  local integer vector2 = VectorProjectVector(v,vector1)
  set udg_vectorX = udg_vectorX - udg_vectorX[v]*ParticlePeriod()
  set udg_vectorY = udg_vectorY - udg_vectorY[v]*ParticlePeriod()
  set udg_vectorZ = udg_vectorZ - udg_vectorZ[v]*ParticlePeriod()
  if IsTerrainPathable(GetUnitX(u),GetUnitY(u), PATHING_TYPE_WALKABILITY) then  
      call PauseUnit(u,false)
      call RemoveParticle(u,false)
endif
  call VectorScale(vector2, -2)
  call VectorAdd(v, vector2)
  call VectorScale(v, 0.90)
  call VectorDestroy(vector1)
  call VectorDestroy(vector2)
  set u = null
endfunction

Replacing "GroundHit_Bounce" with the above function should make it bounce off walls.

so i can do wut HINDYhat said and then place this code into replacing the "GroundHit_Bounce"?
 
You guys are all so very nice and AWSOME! gg thanks~ ill post ne more problems, and Poot, merge that other thread for me thanks

Ok, so tell me if this is all good. This is all the code I made and I put it together like this.

JASS:
function Trig_Test_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'Your Ability Id'
endfunction
function Trig_Test_Actions takes nothing returns nothing
  local unit u = GetTriggerUnit()
  local real r=GetUnitFacing(u)*3.14159/180.
  call clsParticleCreate(u)
  call MakeUnitFlyable(u)
  call GroupAddUnit(udg_particleGroup, u)
  call ParticleSetSpeed(u,Cos(r)*500,Sin(r)*500,2000)
function GroundHit_BounceJump takes nothing returns nothing
  local unit u = GetEnumUnit()
  local integer i = GetUnitUserData(u)
  local integer p = udg_clsParticlePlace[i]
  local integer v = udg_clsParticleSpeed[i]
  local integer vector1 = VectorGetTerrainNormal(udg_vectorX, udg_vectorY, 25.0)
  local integer vector2 = VectorProjectVector(v,vector1)
  set udg_vectorX = udg_vectorX - udg_vectorX[v]*ParticlePeriod()
  set udg_vectorY = udg_vectorY - udg_vectorY[v]*ParticlePeriod()
  set udg_vectorZ = udg_vectorZ - udg_vectorZ[v]*ParticlePeriod()
  if IsTerrainPathable(GetUnitX(u),GetUnitY(u), PATHING_TYPE_WALKABILITY) then
      call PauseUnit(u,false)
      call RemoveParticle(u,false)
endif
  call VectorScale(vector2, -2)
  call VectorAdd(v, vector2)
  call VectorScale(v, 0.90)
  call VectorDestroy(vector1)
  call VectorDestroy(vector2)
  set u = null
endfunction
  call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_RemoveParticle")
  call ParticleAddForce(u, Wind())
  call ParticleAddForce(u, G())
  call TriggerSleepAction(1)
  call clsParticleDestroy(u)
  call GroupRemoveUnit(udg_particleGroup, u)
  set u = null
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
    set gg_trg_Test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Test, Condition( function Trig_Test_Conditions ) )
    call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
This is a crazy code.

Is that right? of course, i changed the "Test" to "Jump"(the name of the trig) and made the ability the A000 thing
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Try it out, say what happens.

But no, your new function doesn't go inside the old one.

You should have something like this;

JASS:
function GroundHit_BounceJump takes nothing returns nothing
  local unit u = GetEnumUnit()
  local integer i = GetUnitUserData(u)
  local integer p = udg_clsParticlePlace[i]
  local integer v = udg_clsParticleSpeed[i]
  local integer vector1 = VectorGetTerrainNormal(udg_vectorX, udg_vectorY, 25.0)
  local integer vector2 = VectorProjectVector(v,vector1)
  set udg_vectorX = udg_vectorX - udg_vectorX[v]*ParticlePeriod()
  set udg_vectorY = udg_vectorY - udg_vectorY[v]*ParticlePeriod()
  set udg_vectorZ = udg_vectorZ - udg_vectorZ[v]*ParticlePeriod()
  if IsTerrainPathable(GetUnitX(u),GetUnitY(u), PATHING_TYPE_WALKABILITY) then
      call PauseUnit(u,false)
      call RemoveParticle(u,false)
  endif
  call VectorScale(vector2, -2)
  call VectorAdd(v, vector2)
  call VectorScale(v, 0.90)
  call VectorDestroy(vector1)
  call VectorDestroy(vector2)
  set u = null
endfunction
function Trig_Test_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'Your Ability Id'
endfunction
function Trig_Test_Actions takes nothing returns nothing
  local unit u = GetTriggerUnit()
  local real r=GetUnitFacing(u)*3.14159/180.
  call clsParticleCreate(u)
  call MakeUnitFlyable(u)
  call GroupAddUnit(udg_particleGroup, u)
  call ParticleSetSpeed(u,Cos(r)*500,Sin(r)*500,2000)
  call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_BounceJump")
  call ParticleAddForce(u, Wind())
  call ParticleAddForce(u, G())
  set u = null
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
    set gg_trg_Test = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Test, Condition( function Trig_Test_Conditions ) )
    call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction

And don't forget to change the rawcode!


Threads merged, it looks a little odd because it didn't concatenate them -.-
 
Status
Not open for further replies.
Top