12262006, 08:42 AM  #16 
User
Respected User

You should update this system to use JASSHelper's structs, it would make it easier to use.

Sponsored Links  Login to hide this ad! 

02232007, 08:13 AM  #17 
User
Join Date: Dec 2006
Posts: 226

I'm not very familiar with Vectors :p
__________________ JASS: // create the unit's position vector set vectors[1]=VectorCreate(0.0,0.0,100.0) // create the unit's starting speed vector set vectors[2]=VectorCreate(GetRandomReal(100.0, 100.0)*BouncyPeriod(),GetRandomReal(100.0, 100.0)*BouncyPeriod(),500.0*BouncyPeriod()) // create the gravity acceleration vector set vectors[3]=VectorCreate(0.0, 0.0, 800.0*BouncyPeriod()*BouncyPeriod()) // to avoid having too many variables, we store these vectors into another vector set vectors[4]=VectorCreate(I2R(vectors[1]), I2R(vectors[2]), I2R(vectors[3])) call SetUnitUserData(udg_BouncyBall, vectors[4]) The vectors[1] refers to x? vectors[2] to y? vectors[3] to z? Or not? If not, then the vectors[1] is created at Location(0.00,0.00) at height 100.00, the vectors[2] is created at Location(GetRandomReal(1.00,1.00),GetRandomReal(1.00,1.00)) at height 5.00, and the vectors[3] is created at Location(0.00,0.00) at height 0.08? And then the vectors[4] is created at Location(vectors[1],vectors[2]) at height vectors[3], and udg_BounceBall's custom value is set to vectors[4]. JASS: // retrieve vector data from unit's custom value set vectors[1]=GetUnitUserData(udg_BouncyBall) set vectors[2]=R2I(VectorGetX(vectors[1])) set vectors[3]=R2I(VectorGetY(vectors[1])) set vectors[4]=R2I(VectorGetZ(vectors[1])) There, the vectors[1] retrieves the custom unit value of udg_BounceBall, and sets vectors[2], vectors[3], and vectors[4] to respectivly X, Y and Z of vectors[1]? JASS: // change the ball's position according to it's speed call VectorAdd(vectors[2], vectors[3]) // change the balls speed by the gravity acceleration call VectorAdd(vectors[3], vectors[4]) The vectors[2] and vectors[3] are added (vectors[2]'s X, Y, and Z are respectivly added to vectors[3]'s X, Y, and Z?), and the vectors[3] and vectors[4] are added. vectors[2] is the result of the add, and vectors[3] is the result of the second add? JASS: // verify terrain collision if h >= VectorGetZ(vectors[2]) then // get terrain normal vector set vectors[5]=VectorGetTerrainNormal(VectorGetX(vectors[2]), VectorGetY(vectors[2]), 32.0) // get the component of speed vector that is perpendicular to the terrain set vectors[6]=VectorProjectVector(vectors[3], vectors[5]) // invert the ball's speed component that's perpendicular to terrain call VectorScale(vectors[6], 2.0) call VectorAdd(vectors[3], vectors[6]) // cleanup the temporary vectors call VectorDestroy(vectors[5]) call VectorDestroy(vectors[6]) // add land effect set eff = AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", VectorGetX(vectors[2]), VectorGetY(vectors[2])) call DestroyEffect(eff) endif There, even with the //informations, I don't understand what does most of lines (the add, scale, and set vectors[index] = blabla). (even with Functions List trigger) Also, if I change the 32.0 (VectorTerrainGetNormal) to something higher, what happens? And if it is lower? So does for the 2.0 for the VectorScale. JASS: // move the ball call SetUnitX(udg_BouncyBall, VectorGetX(vectors[2])) call SetUnitY(udg_BouncyBall, VectorGetY(vectors[2])) call SetUnitFlyHeight(udg_BouncyBall, VectorGetZ(vectors[2])h, 0.0) So, we need only vectors[2] to move the ball? 
02242007, 06:23 PM  #18 
PhD
Cinematics Moderator

This has been answered on the first page. Vector one stores the adresses on vector2 3 and 4, which are place speed and gravity.
__________________vector2 is increased by the speed (vector3) and the speed in increased by the gravity (acceleration, vector4) Then, after that the unit is moved to vector 2, the place. if you change the 32 in terrainnormal itll take a larger piece of terrain to calculate the vector. a larger number sorta smoothens out the terrain. 
07202007, 01:43 AM  #19 
User
Join Date: Jan 2007
Posts: 157

Can't
JASS: set eff = AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", VectorGetX(vectors[2]), VectorGetY(vectors[2])) call DestroyEffect(eff) JASS: call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", VectorGetX(vectors[2]), VectorGetY(vectors[2]))) Last edited by ClichesAreSt00pid : 07202007 at 01:44 AM. 
07202007, 02:05 AM  #20 
Procrastination Incarnate
Development Director

Yes, it can. The demo trigger sucks.
__________________ 
07202007, 11:03 AM  #21 
BuranX

btw the feature to store vec into vec is lame... you could simply create 8 16 arrays ^^ but ! it's a allready old sys so no really suggestions + comments. it's just for info (+ you know it self ;))

10062007, 10:59 AM  #22 
User
Join Date: Oct 2007
Posts: 1

how to let a new unit bounce couse i inpoted the costum script but i dont see how to let a unit bounce and wich unit:( (btw im nto very good whit jass):( and i need a other spot then at the start lcation of red and i need one unity type to bounce
Last edited by Doom : 10062007 at 11:15 AM. 
03032008, 05:34 PM  #23 
Procrastination Incarnate
Development Director

Major update: I made a vJass version of vectors, greatly optimised and easier to use. Details in first post.
__________________Last edited by Anitarf : 03032008 at 05:35 PM. 
03042008, 10:02 AM  #24 
master of fugue
Join Date: Jun 2007
Posts: 2,453

Really Nice Job, have some
__________________The only thing I did not like is that you named the class vector. I prefer uppercase class names  Vector. (ye I'm silly) Also you might want to consider using better error messages JASS: "setLength: Attempted to set the length of a vector to zero!" "projectionVector: Attempted to project onto a vector with no length!" "projectionPlane: Attempted to project onto an undefined plane!" "projectPlane: Attempted to project onto an undefined plane!" "getAngle: Attempted to get angle between vectors with no length!" "rotate: Attempted to project onto a vector with no length! // This was misleading" "isInCylinder: Cylinder with no height!" "isInCone: cone with no height!" It really helps when you know exactly in what function the error happened, especially with similar or repeating error messages. Once again great job. EDIT: Oh and create one default bouncing ball on startup and maybe display a message: Press ESC for more balls. Last edited by cohadar : 03042008 at 10:05 AM. 
03042008, 12:04 PM  #25 
BuranX

NOOOOOOOOOOOOOOOOOOOOOOOOO !
__________________the wisps have fucked setups =\ and it looks like a flying shit. FIX IT ! (Max Pitch / Roll Angles set to 0) + it would be better to import custom wisp with height offset (Z = 0) + imho Archimode missle was better... (due this laks (above)) and the collision algorithm is a mega overkill shit >.< (better simply remove it) x^2 omg... 30=900 xD loled fuck... or you may educate someone else to use such way of collision detection. but well the previous version was the mega uber imba +1 *DRINK* it was the begin of Vectors in wc3 (publick). so :pray: Anitarf + iNfraNe 
03042008, 01:08 PM  #26  
master of fugue
Join Date: Jun 2007
Posts: 2,453

Quote:
Ye I was gonna suggest him to attach some ribbon to the wisp but forgot. 

03042008, 02:23 PM  #27 
BuranX

cohadar you mean particles ^^ ?
__________________but well the reasons why currebtly wisps suck is the roll and pitch issue on cliffs... TT 
03042008, 02:45 PM  #28 
Procrastination Incarnate
Development Director

It's just a lame sample, no need to get upset about it.
__________________Sure, the collision detection is horrible, but I just didn't feel like using a group and doing an enum in range. This works well enough; once your framerate starts dropping, there are usualy enough bouncy balls that they quickly collide and die off. 
03042008, 04:55 PM  #29  
BuranX

Quote:
but anyway awesome stuff need awesome presentation ^^ (thats why grim001 demo was so impressive) 

03042008, 05:43 PM  #30 
Procrastination Incarnate
Development Director

Well, for an awesome presentation, wait about a year; I might make a map project out of this.
__________________ 
Thread Tools  Search this Thread 

