Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   flickering light (https://forums.graalonline.com/forums/showthread.php?t=25014)

ShadoWarrior911 03-04-2002 02:19 AM

flickering light
 
Please help me design an Npc of a light effect of a light that flickers by changing in magnification slightly. I have tried and tried, but to no avail, and i have only recently started to learn c++(which I know Graal Uses in its own way). Also, would it be possible/easier to do this with a .gani?

la_builder 03-04-2002 03:01 AM

{full rights preserved to graal2001 i think lol}
if (created)
dontblock;
//#CLIENTSIDE
if (playerenters) {
setcoloreffect 1,1,0,0.4;
drawaslight;
this.light = 2;
timeout = 0.05;
}
if (timeout) {
this.light += random(-0.2,0.2);
if (!(this.light in |1,3|))
this.light = 2;
setzoomeffect this.light;
timeout = 0.05;
}

Faheria_LAT3 03-04-2002 03:12 AM

Quote:

Originally posted by la_builder
all rights reserved

screen_name 03-04-2002 05:16 AM

Quote:

Originally posted by Kaimetsu
Go for gani scripts, they make placement much neater.
yeah :P

a lot easier

joseyisleet 03-04-2002 05:21 AM

1 Attachment(s)
-=Josey=-
This may be rather long, but, I'm at work and had to do it quickly. You can change it or do whatever you want with it. It's attached.

ShadoWarrior911 03-04-2002 12:08 PM

Thanks
 
Hey Guys, Thanks alot for helpng me out with the code, ill try them all out when i have some time

~ShadoWarrior:D

Saga2001 03-04-2002 12:55 PM

You could even use params with the ganis. That way you could just set the gani as like light4.png and than light4.png or something....

la_builder 03-05-2002 03:13 AM

lol i wrote all right reserved caus i didnt make it its graal 2001's
because i didnt want some ******* people to say "you stole it from graal 2001 you noobie npc stealer" lol a p2p server can use it without any probs i think

cell424 03-06-2002 06:16 PM

These scripts are from g2k1 and must be given full credit to.

NPC Code:

if (created)
dontblock;
//#CLIENTSIDE
if (playerenters) {
setcoloreffect 1,1,0,0.4;
drawaslight;
this.light = 2;
timeout = 0.05;
}
if (timeout) {
this.light += random(-0.2,0.2);
if (!(this.light in |1,3|))
this.light = 2;
setzoomeffect this.light;
timeout = 0.05;
}



NPC Code:

if (created)
dontblock;
//#CLIENTSIDE
if (playerenters) {
setcoloreffect 1,0,0,0.99;
drawaslight;
this.light = 2;
timeout = 0.05;
}
if (timeout) {
this.light += random(-0.2,0.2);
if (!(this.light in |1,3|))
this.light = 2;
setzoomeffect this.light;
timeout = 0.05;
}


btedji 03-06-2002 08:24 PM

Quote:

Originally posted by la_builder
{full rights preserved to graal2001 i think lol}
if (created)
dontblock;
//#CLIENTSIDE
if (playerenters) {
setcoloreffect 1,1,0,0.4;
drawaslight;
this.light = 2;
timeout = 0.05;
}
if (timeout) {
this.light += random(-0.2,0.2);
if (!(this.light in |1,3|))
this.light = 2;
setzoomeffect this.light;
timeout = 0.05;
}

That one would skip when it gets above 3 or below 1

SSRobgeta 03-07-2002 06:17 PM

Why don't you just do...
NPC Code:

// NPC made by Rob Getashu
if (playerenters) {
setcoloreffect 215,0,1,0.99;
setzoomeffect 2;
dontblock;
drawaslight;
}
//#CLIENTSIDE
if (playerenters || timeout) {
setzoomeffect random(0.1,2);
timeout = random(0.1,0.5);
}



All times are GMT +2. The time now is 03:53 AM.

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