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 05-18-2002, 09:28 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Possible?

I was just wondering if it was possible to have an npc that coulds the time that youa re standng still and everytime you move the time resets
__________________
Reply With Quote
  #2  
Old 05-18-2002, 09:33 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
umm correct me if im wrong Kai but maybe a timevar and a position checker that checks to see if the position has moved like

NPC Code:

if (!playerx==playeroldx || !playery==playeroldy) {
this.idletime=0;
}



or somethin like that for the set back part??
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #3  
Old 05-18-2002, 10:00 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Quote:
Originally posted by Dustey4Ever
umm correct me if im wrong Kai but maybe a timevar and a position checker that checks to see if the position has moved like

NPC Code:

if (!playerx==playeroldx || !playery==playeroldy) {
this.idletime=0;
}



or somethin like that for the set back part??
Thanx but Kai its not who ever you talking about lol but thanx
__________________
Reply With Quote
  #4  
Old 05-18-2002, 10:20 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
sorry Kai posts here the most and usually fixes people mistakes=p, hmm.. is it just me or have been less people postin here lately
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #5  
Old 05-18-2002, 10:50 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
yeah not as much ppl used to post here alot but not as much anymroe
__________________
Reply With Quote
  #6  
Old 05-18-2002, 10:55 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
its probably laggy and not very good but try this sucka:

NPC Code:

NPC Code:

if (created) {
timeout=1;
}
if (timeout) {
this.oldx=this.newx;
this.oldy=this.newy;
this.newx=playerx;
this.newy=playery;
if ((this.newx==this.oldx)&&(this.newy==this.old)) {
message Player Did Not Move!;
}
timeout=1;
}




thats just a little bit, but toy with it ...
Reply With Quote
  #7  
Old 05-18-2002, 10:56 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
*starts to tally reasons*

1. They dont script anymore
2. They dont play graal anymore
3. They are so good they dont need help
4. They figure it out themselves
5. They just dont care
6. They just dont care about this forum and would rather let it rot
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #8  
Old 05-18-2002, 11:06 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
Quote:
Originally posted by nyghtGT
its probably laggy and not very good but try this sucka:

NPC Code:

NPC Code:

if (created) {
timeout=1;
}
if (timeout) {
this.oldx=this.newx;
this.oldy=this.newy;
this.newx=playerx;
this.newy=playery;
if ((this.newx==this.oldx)&&(this.newy==this.old)) {
message Player Did Not Move!;
}
timeout=1;
}




thats just a little bit, but toy with it ...
umm that wouldnt work I dont think because it set the oldx and y before it messages anything or does anything, so it would always stay player did no move if im not mistaken, heres how i would do this
NPC Code:

if (playereneters) {
timeout=1;
}
if (timeout) {
if ((playerx==this.playeroldx)&&(playery==this.player oldy)) {
this.idletime++;
message Idle for #v(this.idletime);
}
if ((!playerx==this.playeroldx)||(!playery==this.play eroldy)) {
this.idletime=0;
message;
}
this.oldx=playerx;
this.oldy=playery;
timeout=1;
}



would this work?
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same

Last edited by Dustey4Ever; 05-18-2002 at 11:25 AM..
Reply With Quote
  #9  
Old 05-18-2002, 11:13 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
remember...

when you do an arguement such as:
NPC Code:

you use parenthesis around each 2 arguements:

if ((arguement1==arguement2)&&(arguement3==arguement4 )) {
}

Reply With Quote
  #10  
Old 05-18-2002, 11:22 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
Quote:
Originally posted by nyghtGT
remember...

when you do an arguement such as:
NPC Code:

you use parenthesis around each 2 arguements:

if ((arguement1==arguement2)&&(arguement3==arguement4 )) {
}

yes, thats the "proper" way, but on my graal it work either way, i really should use tht way more
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #11  
Old 05-18-2002, 11:30 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 Dustey4Ever


yes, thats the "proper" way, but on my graal it work either way, i really should use tht way more
Ummmmm...Actually thats wrong, well nothing is wrong with coding unless its syntax, but you are not suppose, its just personal style, either works, and either are the right way. The having ((this==this)&&(that==that)) is for multiple statement test as follows:
NPC Code:

if (playerenters && (strequals(#a,Saga2001) || strequals(#a,Nick P2P)) {
// do this
}



But it doesn't really matter...
__________________

!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
  #12  
Old 05-18-2002, 11:35 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
I know it doesnt really matter, but it looks cleaner in my opinion
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #13  
Old 05-18-2002, 11:50 AM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
for your script just do this.
NPC Code:

if(created) timeout=.05;

if(timeout){
if(!keydown(0) && !keydown(1) && !keydown(2) && !keydown(3)){
this.NotMoving++;
}else{
this.NotMoving=0;
}
timeout=.05;
}

Reply With Quote
  #14  
Old 05-18-2002, 01:31 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Bhala
for your script just do this.
NPC Code:

if(created) timeout=.05;

if(timeout){
if(!keydown(0) && !keydown(1) && !keydown(2) && !keydown(3)){
this.NotMoving++;
}else{
this.NotMoving=0;
}
timeout=.05;
}

even better:
NPC Code:

if (created) {
timeout=0.05;
}
if (timeout) {
for(i=0;i<3;i++) {
if (keydown(i)) {
this.move++;
} else {
this.move=0;
}
}
}

Reply With Quote
  #15  
Old 05-18-2002, 01:40 PM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
Quote:
Originally posted by nyghtGT

even better:
NPC Code:

if (created) {
timeout=0.05;
}
if (timeout) {
for(i=0;i<3;i++) {
if (keydown(i)) {
this.move++;
} else {
this.move=0;
}
}
}

i cant get either one of em ta werk on the second one all it does it stay at 3 and i cantfigrue out what im doing wrong!
__________________
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 01:11 PM.


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