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 06-01-2002, 06:10 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
timeout, for, callnpc

Can anyone enlighten me why these NPCs will not work:
NPC Code:

// Number One
if (created||playerenters) {
timeout=0.05;
}
if (timeout) {
do3();
do2();
sleep 0.05;
seteffect 1,0,0,0;
timeout=0.05;
}

// FUNCTIONS
function do3() {
for (i=0;i<npcscount;i++) {
callnpc i,dothree;
}
}
function do2() {
for (i=0;i<npcscount;i++) {
callnpc i,dotwo;
}
}


NPC Code:

// Number Two
if (dotwo) {
sleep 0.075;
seteffect 0,1,0,0;
}


NPC Code:

// Number Three
if (dothree) {
sleep 0.1;
seteffect 0,0,1,0;
}


It's basically to beat that 20fps thing.
Reply With Quote
  #2  
Old 06-01-2002, 09:09 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Re: timeout, for, callnpc

Quote:
Originally posted by nyghtGT
Can anyone enlighten me why these NPCs will not work:
NPC Code:

// Number One
if (created||playerenters) {
timeout=0.05;
}
if (timeout) {
do3();
do2();
sleep 0.05;
seteffect 1,0,0,0;
timeout=0.05;
}

// FUNCTIONS
function do3() {
for (i=0;i<npcscount;i++) {
callnpc i,dothree;
}
}
function do2() {
for (i=0;i<npcscount;i++) {
callnpc i,dotwo;
}
}


NPC Code:

// Number Two
if (dotwo) {
sleep 0.075;
seteffect 0,1,0,0;
}


NPC Code:

// Number Three
if (dothree) {
sleep 0.1;
seteffect 0,0,1,0;
}


It's basically to beat that 20fps thing.
Um...not sure but....i think you have to change this
NPC Code:

// Number Two
if (dotwo) {
sleep 0.075;
seteffect 0,1,0,0;
}


i dont think graal can sleep that high...0.05 is its min...im almost posotive
__________________
Reply With Quote
  #3  
Old 06-01-2002, 09:15 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
Re: Re: timeout, for, callnpc

Quote:
Originally posted by Goboom


Um...not sure but....i think you have to change this
NPC Code:

// Number Two
if (dotwo) {
sleep 0.075;
seteffect 0,1,0,0;
}


i dont think graal can sleep that high...0.05 is its min...im almost posotive
0.075 is longer then 0.05
Reply With Quote
  #4  
Old 06-02-2002, 07:57 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
isn't callnpc a little laggy as well?
Reply With Quote
  #5  
Old 06-02-2002, 01:58 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 Kaimetsu
You cannot 'beat' the 20fps thing.

You can try until you're an old man, you still won't get Graal to run any faster than 20fps.
Can I get a cookie for trying?
Reply With Quote
  #6  
Old 06-02-2002, 02:02 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 Kaimetsu


A cookie with "Give it up" written on it.
Cookies are cookies...
Reply With Quote
  #7  
Old 06-02-2002, 02:21 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 Kaimetsu
I'm amazed that I was able to correct my typo in both posts without an "Edited by Kaimetsu blahblah"
Congradulations.....
I think
Reply With Quote
  #8  
Old 06-02-2002, 11:18 PM
BBflat BBflat is offline
Registered User
BBflat's Avatar
Join Date: Apr 2002
Location: United States of America
Posts: 573
BBflat is on a distinguished road
Quote:
Originally posted by Kaimetsu
I'm amazed that I was able to correct my typo in both posts without an "Edited by Kaimetsu blahblah"
I have never seen any of those things after editing my posts here... I am really confused.
Reply With Quote
  #9  
Old 06-03-2002, 01:20 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
Quote:
Originally posted by BBflat

I have never seen any of those things after editing my posts here... I am really confused.

it just depends on how long after the post it shows up, depending on what you set it to
__________________
[signature]insert here[/signature]
Reply With Quote
  #10  
Old 06-04-2002, 10:55 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
-FooL-

I did this and I thought I saw Blue and Red going. Not sure though... too fast x.x

NPC Code:

NPC1:
if (playerenters){
sleep .05;
timeout=.05;
}
if (timeout){
this.show=1-this.show;
if (this.show=1)seteffect 0,1,0,0;
else seteffect 0,0,0,0;
timeout=.05;
}

NPC2:
if (playerenters){
sleep .06;
timeout=.05;
}
if (timeout){
this.show=1-this.show;
if (this.show=1)seteffect 1,0,0,0;
else seteffect 0,0,0,0;
timeout=.05;
}

NPC3:
if (playerenters){
sleep .07;
timeout=.05;
}
if (timeout){
this.show=1-this.show;
if (this.show=1)seteffect 1,0,0,0;
else seteffect 0,0,0,0;
timeout=.05;
}



Ech I have a headache now from all the flashy lights. And it seems to run just slightly faster than a timeout=.05 flashing "HI!" message NPC.

Ugh. This is worse than pokemon. I'm stopping now. x.x
__________________

!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
  #11  
Old 06-04-2002, 11:05 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Kai's Right, 20FPS is it

*****! 0.075 probably won't work because it uses 3 decimals. I think Graal can only handle 2! Heh, and You can't beat the system unless you re-program Graal =/
What is the purpose of the more than 20 frames per second??
The human eye can not distinguish many frames quickly =/
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #12  
Old 06-05-2002, 12:17 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
Re: Kai's Right, 20FPS is it

Quote:
Originally posted by Projectshifter
*****! 0.075 probably won't work because it uses 3 decimals. I think Graal can only handle 2! Heh, and You can't beat the system unless you re-program Graal =/
What is the purpose of the more than 20 frames per second??
The human eye can not distinguish many frames quickly =/
---Shifter
So, 0.07000000000 wont work?

What you are trying to say is you don't think decimals in the degree of thousandths won't work. But I think they do.
Reply With Quote
  #13  
Old 06-05-2002, 01:38 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
Re: Re: Kai's Right, 20FPS is it

Quote:
Originally posted by nyghtGT

So, 0.07000000000 wont work?

What you are trying to say is you don't think decimals in the degree of thousandths won't work. But I think they do.
lol, why did you include so many extra zero's when .07 is the same thing, lol
__________________
[signature]insert here[/signature]
Reply With Quote
  #14  
Old 06-05-2002, 01:42 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
Re: Re: Re: Kai's Right, 20FPS is it

Quote:
Originally posted by screen_name


lol, why did you include so many extra zero's when .07 is the same thing, lol
He was saying 3 digit decimals will not work...

So I pointed out the fact that they do work and any amount of decimal should work, just not for timeouts...
Reply With Quote
  #15  
Old 06-05-2002, 03:46 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
Well as Kai so KEENLY pointed out. You cannot beat the 20fps...period. So don't sweat it. I wish you could too. However the amount of decimils in a timeout or a sleep do not matter...however as you get further into the sleep it just becomes pointless because:
sleep .05;
is the same as:
sleep .051;

so no biggie...
__________________

!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
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 05:08 AM.


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