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

Wall bounce trigger

Status
Not open for further replies.
I mean this function:
beznzvug.png

Like in pudge wars.
 
Let r be the angle of the ray, and R the angle of reflection.

If the wall is flat (i.e., if its angle is 0), then we know that r + R = Pi/2.

Now suppose the wall has angle w. Then rotate the diagram by -w,
so that the wall is now flat again, and the angles of the ray and its
reflection are now r - w and R - w, respectively.

We then have (r - w) + (R - w) = Pi/2, which should give you enough
information to find R.

From wiki answers, http://wiki.answers.com/Q/Is_there_...he_angle_of_the_ray_and_the_angle_of_the_wall

Google is your friend.
 
Let r be the angle of the ray, and R the angle of reflection.

If the wall is flat (i.e., if its angle is 0), then we know that r + R = Pi/2.

Now suppose the wall has angle w. Then rotate the diagram by -w,
so that the wall is now flat again, and the angles of the ray and its
reflection are now r - w and R - w, respectively.

We then have (r - w) + (R - w) = Pi/2, which should give you enough
information to find R.

From wiki answers, http://wiki.answers.com/Q/Is_there_...he_angle_of_the_ray_and_the_angle_of_the_wall

Google is your friend.

This is not a formula for w3 triggering.
I want just something usable in triggering.

It is clear to (180 - Angle) works only for vertical sites.
But i need formula for Horizontal sites.
 

Thanks!
It really works! +REP

Here is the trigger:

  • Set TempReal = 0.00
  • Set TempReal2 = 0.00
  • For each (Integer B) from 0 to 3, do (Actions)
    • Loop - Actions
      • Set TempReal = ((Real((Integer B))) x 90.00)
      • Set TempPoint = (Position of TempUnit)
      • Set TempPoint2 = (TempPoint offset by 25.00 towards TempReal degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at TempPoint2) Equal to Lordaeron Summer - Dark Grass
        • Then - Actions
          • Set TempReal = ((Real((Integer B))) x 90.00)
          • Set TempReal2 = (Facing of TempUnit)
          • Set TempReal2 = ((TempReal2 + 180.00) + (2.00 x (TempReal - TempReal2)))
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Can someone please explain to me what is a JASS or a GUI? Sorry i'm new

GUI - game user inteface. This is what you look at in normal editor in tirggers editor.
Jass in language used in war3 to perform any types of trigger action.
Whenever you create a normal trigger in GUI you can simply convert it to your own text via menu in Trigger Editor and text you gonna see is Jass.

GUI is easy to opperate with, although Jass ofers many new options and if you understand it well its quicker and cleaner.
 
  • Like
Reactions: _PV
Level 11
Joined
Sep 12, 2008
Messages
657
And suprisingly, it's alot easier to work with if you know (Edited from: Need) c++, visual basic, c#, html, java codes, or so on. that gives you a full overview..

and that reminds me, can any 1 translate the bounce trigger to jass for me?
i wanna learn how to use that in jass. thanks in advance =]
 
Last edited:

_PV

_PV

Level 7
Joined
Aug 28, 2010
Messages
285
GUI - game user inteface. This is what you look at in normal editor in tirggers editor.
Jass in language used in war3 to perform any types of trigger action.
Whenever you create a normal trigger in GUI you can simply convert it to your own text via menu in Trigger Editor and text you gonna see is Jass.

GUI is easy to opperate with, although Jass ofers many new options and if you understand it well its quicker and cleaner.

it does spark a small light at the end of the tunnel, but it's rather dim... maybe an example would solve my problem? if you please.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
GUI is Graphical User Interface and JASS, or JASS2 as Blizzard called it, is a scripting language.

Example of GUI:
  • Unit - Kill Unit (Triggering Unit)
Example of JASS
JASS:
call KillUnit(GetTriggerUnit())
 
Level 11
Joined
Sep 12, 2008
Messages
657
gui is made out of jass behind the scenes.
gui is more arranged, and easier,
while jass can be messy with the wrong person.

and also, jass is alot better, for the basic idea it can use coordinates/more functions, and etc..
while gui has its limits.
 
Level 2
Joined
Apr 21, 2008
Messages
18
And suprisingly, it's alot easier to work with if you know (Edited from: Need) c++, visual basic, c#, html, java codes, or so on. that gives you a full overview..

and that reminds me, can any 1 translate the bounce trigger to jass for me?
i wanna learn how to use that in jass. thanks in advance =]

JASS:
function Trig_Example_Trigger_Func003Func004C takes nothing returns boolean
    if ( not ( GetTerrainTypeBJ(udg_TempPoint2) == 'Lgrd' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Example_Trigger_Actions takes nothing returns nothing
    set udg_TempReal = 0.00
    set udg_TempReal2 = 0.00
    set bj_forLoopBIndex = 0
    set bj_forLoopBIndexEnd = 3
    loop
        exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
        set udg_TempReal = ( I2R(GetForLoopIndexB()) * 90.00 )
        set udg_TempPoint = GetUnitLoc(udg_TempUnit)
        set udg_TempPoint2 = PolarProjectionBJ(udg_TempPoint, 25.00, udg_TempReal)
        if ( Trig_Example_Trigger_Func003Func004C() ) then
            set udg_TempReal = ( I2R(GetForLoopIndexB()) * 90.00 )
            set udg_TempReal2 = GetUnitFacing(udg_TempUnit)
            set udg_TempReal2 = ( ( udg_TempReal2 + 180.00 ) + ( 2.00 * ( udg_TempReal - udg_TempReal2 ) ) )
        else
        endif
        set bj_forLoopBIndex = bj_forLoopBIndex + 1
    endloop
    call RemoveLocation(udg_TempPoint)
    call RemoveLocation(udg_TempPoint2)
endfunction

//===========================================================================
function InitTrig_Example_Trigger takes nothing returns nothing
    set gg_trg_Example_Trigger = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Example_Trigger, function Trig_Example_Trigger_Actions )
endfunction

I manually created the GUI and converted it. I think these are his vars but I can't be 100% sure.
 
Status
Not open for further replies.
Top