Wc3C.net Vector
 Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar

 12-26-2006, 07:42 AM #16 BlinkBoy User   Respected User   Join Date: Dec 2003 Posts: 835 Submissions (4) You should update this system to use JASSHelper's structs, it would make it easier to use.
 02-23-2007, 07:13 AM #17 Chocobo 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? __________________ __________________ good
02-24-2007, 05:23 PM   #18
iNfraNe
PhD

Cinematics Moderator

Join Date: Dec 2003
Posts: 2,283

Submissions (7)

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.
__________________
Ever so slightly active.
Table:
 Past Projects: The Spirit of Vengeance (Cinematic, Blizzard contest winner) Elimination Tournament Mortar Ball

 07-20-2007, 12:43 AM #19 ClichesAreSt00pid 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)``` be changed to JASS:`call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", VectorGetX(vectors[2]), VectorGetY(vectors[2])))` in your demo trigger? Makes the eff local variable unecessary. Last edited by ClichesAreSt00pid : 07-20-2007 at 12:44 AM.
07-20-2007, 01:05 AM   #20
Anitarf
Procrastination Incarnate

Development Director

Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Yes, it can. The demo trigger sucks.
__________________
 Cinema Workshop released! Let's make some cinematics! Editor's version of the winner of the Blizzard's Cinematic Contest: The Spirit of Vengeance

 07-20-2007, 10:03 AM #21 Toadcop BuranX     Join Date: Jul 2006 Posts: 1,886 Submissions (4) 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 ;))
 10-06-2007, 09:59 AM #22 Doom 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 : 10-06-2007 at 10:15 AM.
03-03-2008, 04:34 PM   #23
Anitarf
Procrastination Incarnate

Development Director

Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Major update: I made a vJass version of vectors, greatly optimised and easier to use. Details in first post.
__________________
 Cinema Workshop released! Let's make some cinematics! Editor's version of the winner of the Blizzard's Cinematic Contest: The Spirit of Vengeance

Last edited by Anitarf : 03-03-2008 at 04:35 PM.

 03-04-2008, 09:02 AM #24 cohadar master of fugue     Join Date: Jun 2007 Posts: 2,453 Submissions (5) 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. __________________ Omg database crash deleted my signature, as a side effect this immensely improved wc3c. Last edited by cohadar : 03-04-2008 at 09:05 AM.
 03-04-2008, 11:04 AM #25 Toadcop BuranX     Join Date: Jul 2006 Posts: 1,886 Submissions (4) 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 __________________
03-04-2008, 12:08 PM   #26
master of fugue

Join Date: Jun 2007
Posts: 2,453

Submissions (5)

Quote:
 Originally Posted by Toadcop + imho Archimode missle was better... (due this laks (above))

Ye I was gonna suggest him to attach some ribbon to the wisp but forgot.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

 03-04-2008, 01:23 PM #27 Toadcop BuranX     Join Date: Jul 2006 Posts: 1,886 Submissions (4) cohadar you mean particles ^^ ? but well the reasons why currebtly wisps suck is the roll and pitch issue on cliffs... TT __________________
03-04-2008, 01:45 PM   #28
Anitarf
Procrastination Incarnate

Development Director

Join Date: Feb 2004
Posts: 8,190

Submissions (19)

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.
__________________
 Cinema Workshop released! Let's make some cinematics! Editor's version of the winner of the Blizzard's Cinematic Contest: The Spirit of Vengeance

03-04-2008, 03:55 PM   #29
BuranX

Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Quote:
 once your framerate starts dropping, there are usualy enough bouncy balls that they quickly collide and die off.
thats true ~30 wisp are almost the max.
but anyway awesome stuff need awesome presentation ^^ (thats why grim001 demo was so impressive)
__________________

03-04-2008, 04:43 PM   #30
Anitarf
Procrastination Incarnate

Development Director

Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Well, for an awesome presentation, wait about a year; I might make a map project out of this.
__________________
 Cinema Workshop released! Let's make some cinematics! Editor's version of the winner of the Blizzard's Cinematic Contest: The Spirit of Vengeance