Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   timeout, for, callnpc (https://forums.graalonline.com/forums/showthread.php?t=30579)

nyghtGT 06-01-2002 06:10 PM

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.

Goboom 06-01-2002 09:09 PM

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

nyghtGT 06-01-2002 09:15 PM

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

Python523 06-02-2002 07:57 AM

isn't callnpc a little laggy as well?

nyghtGT 06-02-2002 01:58 PM

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?

nyghtGT 06-02-2002 02:02 PM

Quote:

Originally posted by Kaimetsu


A cookie with "Give it up" written on it.

Cookies are cookies...

nyghtGT 06-02-2002 02:21 PM

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:rolleyes:

BBflat 06-02-2002 11:18 PM

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.

screen_name 06-03-2002 01:20 AM

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

Saga2001 06-04-2002 10:55 PM

-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

Projectshifter 06-04-2002 11:05 PM

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

nyghtGT 06-05-2002 12:17 AM

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.

screen_name 06-05-2002 01:38 AM

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

nyghtGT 06-05-2002 01:42 AM

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

Saga2001 06-05-2002 03:46 AM

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


All times are GMT +2. The time now is 04:31 PM.

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