wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-26-2006, 08:42 AM   #16
BlinkBoy
User
 
BlinkBoy's Avatar


Respected User
 
Join Date: Dec 2003
Posts: 835

Submissions (4)

BlinkBoy has a spectacular aura about (97)BlinkBoy has a spectacular aura about (97)BlinkBoy has a spectacular aura about (97)BlinkBoy has a spectacular aura about (97)

Outstanding Tutorial

Default

You should update this system to use JASSHelper's structs, it would make it easier to use.
BlinkBoy is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 02-23-2007, 08:13 AM   #17
Chocobo
User
 
Chocobo's Avatar
 
Join Date: Dec 2006
Posts: 226

Chocobo is on a distinguished road (24)

Default

I'm not very familiar with Vectors :p

Collapse 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].


Collapse 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]?


Collapse 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?


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


Collapse 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
Chocobo is offline   Reply With Quote
Old 02-24-2007, 06:23 PM   #18
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

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
iNfraNe is offline   Reply With Quote
Old 07-20-2007, 01:43 AM   #19
ClichesAreSt00pid
User
 
Join Date: Jan 2007
Posts: 157

ClichesAreSt00pid has little to show at this moment (4)

Default

Can't
Collapse JASS:
        set eff = AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", VectorGetX(vectors[2]), VectorGetY(vectors[2]))
        call DestroyEffect(eff)
be changed to
Collapse 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 01:44 AM.
ClichesAreSt00pid is offline   Reply With Quote
Old 07-20-2007, 02:05 AM   #20
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,177

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Yes, it can. The demo trigger sucks.
__________________
Anitarf is offline   Reply With Quote
Old 07-20-2007, 11:03 AM   #21
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

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 ;))
Toadcop is offline   Reply With Quote
Old 10-06-2007, 10:59 AM   #22
Doom
User
 
Join Date: Oct 2007
Posts: 1

Doom has little to show at this moment (0)

Default

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 11:15 AM.
Doom is offline   Reply With Quote
Old 03-03-2008, 05:34 PM   #23
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,177

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Major update: I made a vJass version of vectors, greatly optimised and easier to use. Details in first post.
__________________

Last edited by Anitarf : 03-03-2008 at 05:35 PM.
Anitarf is offline   Reply With Quote
Old 03-04-2008, 10:02 AM   #24
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

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
Collapse 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 10:05 AM.
cohadar is offline   Reply With Quote
Old 03-04-2008, 12:04 PM   #25
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

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
__________________
Toadcop is offline   Reply With Quote
Old 03-04-2008, 01:08 PM   #26
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

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.
cohadar is offline   Reply With Quote
Old 03-04-2008, 02:23 PM   #27
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

cohadar you mean particles ^^ ?
but well the reasons why currebtly wisps suck is the roll and pitch issue on cliffs... TT
__________________
Toadcop is offline   Reply With Quote
Old 03-04-2008, 02:45 PM   #28
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,177

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

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.
__________________
Anitarf is offline   Reply With Quote
Old 03-04-2008, 04:55 PM   #29
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

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)
__________________
Toadcop is offline   Reply With Quote
Old 03-04-2008, 05:43 PM   #30
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,177

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Well, for an awesome presentation, wait about a year; I might make a map project out of this.
__________________
Anitarf is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:20 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2018, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services