Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-04-2002, 09:47 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
vecx,vecy?

what does
vecx,vecy
do??
ive read the definition but i still dont get it, would some redefine it for me?
__________________
Reply With Quote
  #2  
Old 03-04-2002, 10:50 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
its just variables for player movement
__________________
[signature]insert here[/signature]
Reply With Quote
  #3  
Old 03-04-2002, 12:52 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu
Tables!

NPC Code:

Input vecx vecy
0 0 -1
1 -1 0
2 0 1
3 1 0

yay, tables!

you input vecx(playerdir) and it returns stuff as in this table^!
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #4  
Old 03-04-2002, 08:37 PM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
eh

i dont get it.... can someone give me an example?
__________________
Reply With Quote
  #5  
Old 03-04-2002, 09:28 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
use this


NPC Code:

if (playerenters) {
message #v(vecy(playerdir));
}

__________________
[signature]insert here[/signature]
Reply With Quote
  #6  
Old 03-05-2002, 12:08 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
It was added to make random player movement easier...
you know there are 4 dirs a player can have

0 up
1 left
2 down
3 right

so now u watch the table:
NPC Code:

Dir value for vecx value for vecy
0 0 -1
1 -1 0
2 0 1
3 1 0



so if you have the player looking up and u want him to move in this direction you need to substract a value from the players y-Position but the players X-Position has to be the same value so you don't have to add or substract something from the value

ok lets say players x pos is 32 and the players y pos is 25 and he is looking up

playerx+=vecx(playerdir); //nothing will happen to the players x-value
playery+=vecy(playerdir); // oh wonder there is 1 substracted from players y-value and he has gone upwards

so one simple in-use-example (some Staff-Boots)
NPC Code:

if (playertouchsme) toweapons StaffBoots;
// Activating the weapon
if (weaponfired) {
if (this.active==1) this.active=0;
else {
this.active=1;
timeout=.05;
}
}

if (timeout) {
if (this.active==1) {
//now there comes our movement part
for (i=0;i<4;i++) {
if (keydown(i)) {
playerx+=vecx(i);
playery+=vecy(i);
}
}
timeout=.05;
}
}



the for loop is just used to get an easier use for a keydow routine wit less code i is always the value of the dir your char is looking at so while pressing a key your charackter gets faster and he can walk over walls...
__________________
No Webhost at the moment
Reply With Quote
  #7  
Old 03-05-2002, 12:15 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by TDO2000
It was added to make random player movement easier......
Ihat is the most i have ever heard anyone ever say about vecx vecy, good work. .
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #8  
Old 03-05-2002, 03:46 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
thxs

thanks
screen_name and TDO2000
__________________
Reply With Quote
  #9  
Old 03-05-2002, 05:24 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
Re: thxs

Quote:
Originally posted by happyme
thanks
screen_name and TDO2000
yeah thanks everyone i knew about it just wasn't sure
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
Reply


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

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

Forum Jump


All times are GMT +2. The time now is 07:35 PM.


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