Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   vecx and vecy (https://forums.graalonline.com/forums/showthread.php?t=35881)

zorakid2001 08-14-2002 11:42 AM

vecx and vecy
 
I need help getting my npc to drop a weapon in front of the player. plz help me!

RavenTelvecho 08-14-2002 11:52 AM

i still dont get it but here
http://forums.graal2001.com/forums/s...der=descending

zorakid2001 08-14-2002 12:00 PM

I found it there.. its for a restaraunt thing

RavenTelvecho 08-14-2002 12:04 PM

kk i still have to learn it x.x

Python523 08-14-2002 12:45 PM

its a built-in array
vecx vecy
0 0 -1
1 -1 0
2 0 1
3 1 0

screen_name 08-14-2002 01:55 PM

Quote:

Originally posted by Python523
its a built-in array
vecx vecy
0 0 -1
1 -1 0
2 0 1
3 1 0

why does vecx have two values???

*edit* nm, i see, those are the directions

SingleChance 08-14-2002 03:23 PM

Is that the move script somet like this
move 3,4,2,6;
Not quite shore but thats how u do movie scene's i used to do em like this
playerx=;sprite=0;
lol

screen_name 08-14-2002 09:07 PM

Quote:

Originally posted by SingleChance
Is that the move script somet like this
move 3,4,2,6;
Not quite shore but thats how u do movie scene's i used to do em like this
playerx=;sprite=0;
lol

lol, thats old school


the vecx and vecy are used in mostly movement scripts


NPC Code:

vecx vecy dir
0 -1 0
-1 0 1
0 1 2
1 0 3



when you move, then it basically does this
playerx+=vecx(playerdir);
playery+=vecy(playerdir);

so if you move up (dir 0), you will get 0 added to your x value, and -1 added to your y value

Spectre1337 08-16-2002 10:30 AM

Quote:

Originally posted by screen_name


lol, thats old school


the vecx and vecy are used in mostly movement scripts


NPC Code:

vecx vecy dir
0 -1 0
-1 0 1
0 1 2
1 0 3



when you move, then it basically does this
playerx+=vecx(playerdir);
playery+=vecy(playerdir);

so if you move up (dir 0), you will get 0 added to your x value, and -1 added to your y value

We learned something stupid like that in school.. There is the axis thing, its like the big DOT in the middle. the left side is the X and the right is the Y, I think. And you would write the answers to the problems like (0,3) and stuff.. Its freaky.

0 = axis
3 = y

If it were -3, I think it would be X.. im not sure *cries* I hate math

screen_name 08-17-2002 04:38 PM

its called a grid

NPC Code:

Y (+)
|
|
(-) | (+)
X--------|------ X
|
|
|
Y (-)




with the (0,3)

you would move 0 spaces on the x axis and 3 on the Y axis, which is equal to up :)



lol :p

mikepg 08-17-2002 11:40 PM

it's called a cartesian plane, or coordinate plane....they're a lot more fun to play with in Calculus, trust me ;-)

osrs 08-18-2002 01:27 PM

NPC Code:
 Input  vecx  vecy
0 0 -1
1 -1 0
2 0 1
3 1 0


Python523 08-18-2002 01:34 PM

Quote:

Originally posted by osrs
NPC Code:
 Input  vecx  vecy
0 0 -1
1 -1 0
2 0 1
3 1 0


thanks for repeating exactly what screen_name and I posted

screen_name 08-18-2002 03:20 PM

Quote:

Originally posted by mikepg
it's called a cartesian plane, or coordinate plane....they're a lot more fun to play with in Calculus, trust me ;-)
never knew it was called a cartesian plane :)

anyways i liked messing with them when i had a graphing calculator :) that was kinda fun


anyways, as for osrs, how is your post going to help anyone??
you didnt even explain anything, just the array setup Xx

Androk2k1 08-18-2002 10:02 PM

Screenies explanation was best one x.X But how can I use it in script?
Say I want player to move up, when he wants to move up... what flag do I use, and what script? x.X

osrs 08-19-2002 05:07 AM

Quote:

thanks for repeating exactly what screen_name and I posted
No Problem...Now you can Learn about that...:D


All times are GMT +2. The time now is 06:01 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.