February 17, 2020, 03:40:41 PM

Author Topic: Blink (the real blink) help  (Read 2426 times)

Offline Bob

  • Level 7 Expert
  • *****
  • Posts: 212
Blink (the real blink) help
« on: November 10, 2009, 08:20:40 PM »
Zawmbie please help me, I have been working on this forever.

I just want to know how to make a blink skill but it only going a certan distance.

Zawmbie, No-life, Beret, someone help please :D

Offline Texno

  • Level 7 Expert
  • *****
  • Posts: 1144
  • Country: no
    • 1337Forums
Re: Blink (the real blink) help
« Reply #1 on: November 10, 2009, 08:22:52 PM »
what you mean with a blink skill ?...

Offline AvasT

  • Brazilian
  • Level 7 Expert
  • *****
  • Posts: 1292
  • Country: 00
  • Slackline is not a Crime!
Re: Blink (the real blink) help
« Reply #2 on: November 10, 2009, 08:25:08 PM »
i think he wants blind? or blinking invis?




Quote
Never tell your password to anyone.
23:51 - MiB: Hi wife
23:51 - MiB: Imma slap you since you been naughty
23:51 - AvasT: Hi husband
23:51 - AvasT: Sure, on my ass
23:51 - MiB: Imma slap you with my big stick!
23:51 - AvasT: Ok
23:52 - MiB: *-*

Offline Doblez

  • Level 0 Beginner
  • Posts: 17
  • I only play wcs! Its the only fun
Re: Blink (the real blink) help
« Reply #3 on: November 10, 2009, 08:30:09 PM »
I think he mean the "blink skill" from WOW mage a skill like that would also be AWSOME! ;D Am i right in my thoughts Bob?
Just contact me if u have some questions about making race. ;D Im not on the same level as the semi-pro/pro race makers! But i can anyway help. :)

Offline AvasT

  • Brazilian
  • Level 7 Expert
  • *****
  • Posts: 1292
  • Country: 00
  • Slackline is not a Crime!
Re: Blink (the real blink) help
« Reply #4 on: November 10, 2009, 08:38:15 PM »
explain what it does




Quote
Never tell your password to anyone.
23:51 - MiB: Hi wife
23:51 - MiB: Imma slap you since you been naughty
23:51 - AvasT: Hi husband
23:51 - AvasT: Sure, on my ass
23:51 - MiB: Imma slap you with my big stick!
23:51 - AvasT: Ok
23:52 - MiB: *-*

Offline Bob

  • Level 7 Expert
  • *****
  • Posts: 212
Re: Blink (the real blink) help
« Reply #5 on: November 10, 2009, 08:44:10 PM »
it is like a short teleport, im saying if you look at a wall far away you dont teleport to the wall but like 100 feet.
or if your closer then 100 feet you go to whatever your looking at.

Offline [Oddity]TeacherCreature

  • Level 7 Expert
  • *****
  • Posts: 1753
Re: Blink (the real blink) help
« Reply #6 on: November 11, 2009, 05:51:11 PM »
use pushto with some invisibility so it seems like blink?

Like human teleport but the character goes invisible for 1 second ?

Edward D'Andrea

Offline Yiyas

  • Level 7 Expert
  • *****
  • Posts: 494
  • Country: 00
  • The name's Bugger. De-Bugger.
Re: Blink (the real blink) help
« Reply #7 on: November 11, 2009, 06:31:00 PM »
Use trigonometry.
I watch porn for the music.

Zawmbee

  • Guest
Re: Blink (the real blink) help
« Reply #8 on: November 11, 2009, 07:35:56 PM »
The main thing with this is that you need to be very good with math.  Like a graph, you need to find the coordinates over and over again and check them.  Since there will be two variables at times, you need to find a way to change the variables to make the correct choice.  The best I could do for you at the moment is make an ability that teleports you a percentage of the distance in between the view coords and the location you are standing...

Offline Cannon-Fodder

  • Level 2 Apprentice
  • **
  • Posts: 56
  • Skittles, rainbow, skittles, rainbow... @_@
Re: Blink (the real blink) help
« Reply #9 on: November 11, 2009, 08:51:45 PM »
Buh... It looks good to me... o.o
Maybe you need to Float the variables before the math?

Edit: Post I was looking at for the response went POOF. x_x

Offline Berettonawak

  • French
  • Level 7 Expert
  • *****
  • Posts: 3147
  • Country: 00
  • Big Berettonawak is watching you...
    • Coding-Alliance.Com : A bunch of coders? Why not a bunch of players? :P
Re: Blink (the real blink) help
« Reply #10 on: November 11, 2009, 10:20:55 PM »
Code: [Select]
import playerlib
import es

def teleport():
player = playerlib.getPlayer(es.server_var["wcs_userid"])
multi = int(es.server_var["wcs_distance"]) / 100
vector = player.viewVector()
es.setpos(player.userid, (vector[0] - player.x) * multi, (vector[1] - player.y) * multi, (vector[2] - player.z) * multi)
Quote from: N0life
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good.
Quote from: myself
i love tuna juice :D
Quote from: Pietro
=CA= Pietro: back
=CA= Pietro: sorry, was downstair sharing my chocolate with my cat
=CA= Pietro: you should see his face when he ate it xD
Quote from: myself
=CA= Berettonawak: just because you don't have hope doesn't mean we're doomed

Offline Yiyas

  • Level 7 Expert
  • *****
  • Posts: 494
  • Country: 00
  • The name's Bugger. De-Bugger.
Re: Blink (the real blink) help
« Reply #11 on: November 11, 2009, 11:01:05 PM »
Have a bash with this, it's fun regardless::

Probs least exploitable of what's been suggested beforehand
Shouldn't teleport into walls unless at steep angles ~<20 to the wall and in line with it
If a player aims beyond the distance then they will simply fall short of the teleport.

Code: [Select]
block wcs_blink
{
// WC3 Skill Conversion "Blink" by Yiyas
es_xset x 0;es_xset y 0;es_xset z 0;es_xset x1 0;es_xset y1 0;es_xset z1 0;es_xset x2 0;es_xset y2 0;es_xset z2 0;es_xset anglevert 0

es_getplayerlocation x1 y1 z1 server_var(wcs_userid)
es est_GetViewCoord server_var(wcs_userid) x2 y2 z2

es_xmathparse x "x2-x1"
es_xmathparse y "y2-y1"
es_xmathparse z "z2-z1"
es_xmathparse anglevert "atan(z/((x^2+y^2)^0.5))"
// Make sure angle isn't too high so they cant teleport above world boundaries
ifx parse("anglevert < 0.33") do
  {
  // Get the distance of the teleport
  es_xset distance 0
  es_xmathparse distance "(x^2+y^2+z^2)^0.5"
  ifx parse("maxdist < 175") do
    {
    es_xset maxdist 175
    }
  // Is the distance too big?
  ifx parse("distance > maxdist") do
    {
    es_xcopy distance maxdist
    }
  // Cut some off so you aren't teleporting in walls
  es_xmath distance - 50
  // Make sure the teleport is actually worthwhile
  ifx parse("distance > 100") do
    {
    es_xset x3 0;es_xset y3 0;es_xset z3 0;es_xset anglehoriz 0;es_xset coords 0;es_xset newcooldown 0
    es_xmathparse newcooldown "(maxdist - distance)/maxdist*cooldown"
    es_xmathparse anglehoriz "atan(y/x)"
    // Calculate the new co-ords
    ifx true(y) do
      {
      es_xmathparse y3 "sin(anglehoriz)*distance*cos(anglevert)"
      es_xmath y3 abs
      es_xmath y3 * 1
      ifx parse("(y > -30) and (y < 30)") do
        {
        }
      ifx parse("y < 0") do
        {
        es_xmath y3 * -1
        }
      }
    ifx true(x) do
      {
      es_xmathparse x3 "cos(anglehoriz)*distance*cos(anglevert)"
      es_xmath x3 abs
      es_xmath x3 * 1
      ifx parse("(x > -30) and (x < 30)") do
        {
        }
      ifx parse("x < 0") do
        {
        es_xmath x3 * -1
        }
      }
    ifx true(z) do
      {
      es_xmathparse z3 "distance*sin(anglevert)"
      es_xmath z3 abs
      ifx parse("z < 0") do
        {
        es_xmath z3 * -1
        }
      }
    es_xmathparse x "x1+x3"
    es_xmathparse y "y1+y3"
    es_xmathparse z "z1+z3+10"
    es_xformatv coords "%1,%2,%3" x y z
    ifx true(coords) do
      {
      //es_setplayerprop server_var(wcs_userid) CBaseEntity.m_vecOrigin server_var(coords)
      es_xmath z1 + 20
      es est_effect 10 #a 0 dev/ocean.vmt server_var(x1) server_var(y1) server_var(z1) 200 20 0.5 10 5 0 255 100 100 255 20
      es est_god server_var(wcs_userid) 1
      es est_Fade server_var(wcs_userid) 0 0.001 0.25 0 0 0 255
      es est_freeze server_var(wcs_userid) 1
      es est_teleport server_var(wcs_userid) server_var(x) server_var(y) -10000
      es_delayed 0.25 est_freeze server_var(wcs_userid) 0
      es_delayed 0.4 est_god server_var(wcs_userid) 0
      es_delayed 0.25 est_teleport server_var(wcs_userid) server_var(x) server_var(y) server_var(z)
      es_xmath z + 20
      es_delayed 0.1 est_effect 10 #a 0 dev/ocean.vmt server_var(x) server_var(y) server_var(z) 20 200 1.25 10 5 0 255 100 100 255 10
      // put your effects in here
      }
    }
  // Was too close :(
  es_xelse do
    {
    es_tell server_var(wcs_userid) #multi #greenToo Close!!#lightgreen try #greenBlinking#lightgreen #greenfurther#lightgreen away!
    es_xset wcs_ultinotexec 1
    }
  }
// Was too high :(
es_xelse do
  {
  es_tell server_var(wcs_userid) #multi #greenToo High!!#lightgreen try #greenBlinking#lightgreen a #greenshallower#lightgreen angle!
  es_xset wcs_ultinotexec 1
  }
}
« Last Edit: November 12, 2009, 12:18:12 AM by Yiyas »
I watch porn for the music.

Zawmbee

  • Guest
Re: Blink (the real blink) help
« Reply #12 on: November 11, 2009, 11:40:31 PM »
Removed maxdist from coding and set it in setting, this allows the ability to have a point for being leveled up.

Code: [Select]
   "skill1_setting"    "es_xset maxdist 200|es_xset maxdist 250|es_xset maxdist 300|es_xset maxdist 350|es_xset maxdist 400|es_xset maxdist 450|es_xset maxdist 500|es_xset maxdist 550"
    "skill1_cmd"        "es_xdoblock wcs/WCSultimates/wcs_blink"
    "skill1_sfx"        "0"
    "ultimate_cooldown" "0"

Code: [Select]
block wcs_blink
{
// WC3 Skill Conversion "Blink" by Yiyas
es_xset x 0;es_xset y 0;es_xset z 0;es_xset x1 0;es_xset y1 0;es_xset z1 0;es_xset x2 0;es_xset y2 0;es_xset z2 0;es_xset anglevert 0

es_getplayerlocation x1 y1 z1 server_var(wcs_userid)
es est_GetViewCoord server_var(wcs_userid) x2 y2 z2

es_xmathparse x "x2-x1"
es_xmathparse y "y2-y1"
es_xmathparse z "z2-z1"
es_xmathparse anglevert "atan(z/((x^2+y^2)^0.5))"
// Make sure angle isn't too high so they cant teleport above world boundaries
ifx parse("anglevert < 0.33") do
  {
  // Get the distance of the teleport
  es_xset distance 0
  es_xmathparse distance "(x^2+y^2+z^2)^0.5"
  // Is the distance too big?
  ifx parse("distance > maxdist") do
    {
    es_xcopy distance maxdist
    }
  // Cut some off so you aren't teleporting in walls
  es_xmath distance - 50
  // Make sure the teleport is actually worthwhile
  ifx parse("distance > 100") do
    {
    es_xset x3 0;es_xset y3 0;es_xset z3 0;es_xset anglehoriz 0;es_xset coords 0;es_xset cooldown 0
    es_xcopy cooldown maxdist
    es_xmathparse cooldown "(cooldown - distance)/500*10"
    es_xmathparse anglehoriz "atan(y/x)"
    // Calculate the new co-ords
    ifx true(y) do
      {
      es_xmathparse y3 "sin(anglehoriz)*distance*cos(anglevert)"
      es_xmath y3 abs
      es_xmath y3 * 1
      ifx parse("(y > -30) and (y < 30)") do
        {
        }
      ifx parse("y < 0") do
        {
        es_xmath y3 * -1
        }
      }
   ifx true(x) do
      {
      es_xmathparse x3 "cos(anglehoriz)*distance*cos(anglevert)"
      es_xmath x3 abs
      es_xmath x3 * 1
      ifx parse("(x > -30) and (x < 30)") do
        {
        }
      ifx parse("x < 0") do
        {
        es_xmath x3 * -1
        }
      }
    ifx true(z) do
      {
      es_xmathparse z3 "distance*sin(anglevert)"
      es_xmath z3 abs
      ifx parse("z < 0") do
        {
        es_xmath z3 * -1
        }
      }
    es_xmathparse x "x1+x3"
    es_xmathparse y "y1+y3"
    es_xmathparse z "z1+z3+10"
    es_xformatv coords "%1,%2,%3" x y z
    ifx true(coords) do
      {
      //es_setplayerprop server_var(wcs_userid) CBaseEntity.m_vecOrigin server_var(coords)
      es est_teleport server_var(wcs_userid) server_var(x) server_var(y) server_var(z)
      // put your effects in here
      }
    }
  // Was too close :(
  es_xelse do
    {
    es_tell server_var(wcs_userid) #multi #greenToo Close!!#lightgreen try #greenBlinking#lightgreen #greenfurther#lightgreen away!
    es_xset wcs_ultinotexec 1
    }
  }
// Was too high :(
es_xelse do
  {
  es_tell server_var(wcs_userid) #multi #greenToo High!!#lightgreen try #greenBlinking#lightgreen a #greenshallower#lightgreen angle!
  es_xset wcs_ultinotexec 1
  }
}

*EDIT*

Hope you did not mind the modification Yiyas, you did a great job by the way.  Definitely beat me to the punch :D

Offline Yiyas

  • Level 7 Expert
  • *****
  • Posts: 494
  • Country: 00
  • The name's Bugger. De-Bugger.
Re: Blink (the real blink) help
« Reply #13 on: November 12, 2009, 12:04:27 AM »
Lulz I did that just now :P

Added in effects and person dissapears for 0.25s like they do in the real WC3. If someone could get the sounds for Warden's Blink that'd be awesome and just perfect it.

Also note that the cooldown stuff is probably throw-away-able as it requires a bit more editing than most people could cope with, just means if you make a short jump it costs less in terms of cooldown.
« Last Edit: November 12, 2009, 12:06:42 AM by Yiyas »
I watch porn for the music.

Offline Cannon-Fodder

  • Level 2 Apprentice
  • **
  • Posts: 56
  • Skittles, rainbow, skittles, rainbow... @_@
Re: Blink (the real blink) help
« Reply #14 on: November 12, 2009, 08:11:14 AM »
Way to go, Yiyas, you made my head hurt with all that math. :p

Guess it serves me right for leaving my trig-calc book at my old house. XD