Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help Me!!! (https://forums.graalonline.com/forums/showthread.php?t=8802)

wetferret1 08-03-2001 04:06 PM

Help Me!!!
 
How do I make lights? Like Direct 7/8 stuff?And like scroling messages? ANd like scroling tileing like the Survivorgame or like TOT has?

entravial 08-03-2001 05:45 PM

why not ask how to make a playerworld?

SkooL 08-03-2001 06:09 PM

Quote:

Originally posted by entravial
why not ask how to make a playerworld?
He wasn't asking a lot of things. :rolleyes:


Wetferret, I had already PMed you the light script on New Main. Why are you still asking for it? Did it not work correctly? I am sure it did.

Shard_IceFire 08-03-2001 10:06 PM

Um...the light script is rather easy:
NPC Code:

if (created) {
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,.9;
}


then just change the setcoloreffect numbers...they represent R,G,B,Transparancy or something.

LiquidIce00 08-04-2001 12:32 AM

and use if (playerenters)
not if (created)

wetferret1 08-04-2001 02:49 AM

Okay but what about the other questions? I dont really care about light stuff..But How do you do all the other stuff? Because I am a real good Level Maker it's just I never tried at scripting :/ . So I am makeing this hang out place for 2001 and I need some cool scripts! So just post some sweet scripts on this thread.

LiquidIce00 08-04-2001 03:12 AM

a sweet thing is to make glowing orbs.. like a light that glows..
here is a code . im making this out of the top of my head so dont know if they will work or not

NPC Code:

timeout=.15;
if (timeout) {
check();
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow*.1;
}
function check() {
if (this.glow<9&&this.goback=0) { this.glow++; }
if (this.glow>0&&this.goback=1) { this.glow--; }
if (this.glow=0&&this.goback=1) { this.goback=0; }
if (this.glow=9&&this.goback=0) { this.goback=1; }
}



or you can do a random one...

NPC Code:

timeout=.15;
if (timeout) {
this.glow=random(0,10);
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow*.1;
}



or one that keeps going shinier..

NPC Code:

timeout=.15;
if (timeout) {
this.glow=(this.glow+1)%.9;
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow;
}



or one that goes from shiny to non shiny...

NPC Code:

timeout=.15;
if (timeout) {
this.glow=(this.glow+.9)%1;
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow;
}



or one that blinks

NPC Code:

timeout=.15;
if (timeout) {
if (this.glow=.9) { this.glow=0; }
else { this.glow=.9; }
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow;
}


wetferret1 08-04-2001 03:15 AM

Hey thank you soo much! Those are sweet! ANd thank you for NOT flaming me because I asked a stupid question..

LiquidIce00 08-04-2001 03:17 AM

1 Attachment(s)
okay for tile scrolling
thats alot more confusing
since i am a nice person i will show you a script
BUT YOU CANT USE IT! cuz i use it in my own playerworld..
this is like a little snake that follows red tiles. ill post a pic too so you can see what it looks like
(and it also displays a message that can be set by any1 wearing (Owner) tag)


btw this is for free pw's so i dunno how u would change it to work to p2p

and it has 1 little bug which sometimes it freezes if its in an opened space.. (it freezes like for 1/2 a sec but its noticable)

NPC Code:

timereverywhere;
// NPC made by LiquidIce (Owner)
this.wormlength=8;

if (playerenters) {
checkarray();
timeout=.05;
}

if (timeout) {
movearray();
findnext();
//here we do the updates and junk
putobjects();
//do message
displaymessage();

timeout=.075;
}

function checkarray() {
setarray wormx, this.wormlength+1;
setarray wormy, this.wormlength+1;

for (this.i=0;this.i<this.wormlength;this.i++) {
if (wormx[this.i]=0) { wormx[this.i]=x; }
}
for (this.i=0;this.i<this.wormlength;this.i++) {
if (wormy[this.i]=0) { wormy[this.i]=y; }
}
}

function movearray() {
this.i=this.wormlength;
while (this.i>0) {
wormx[this.i]=wormx[this.i-1];
wormy[this.i]=wormy[this.i-1];
this.i--;
}
}

function findnext() {
this.bad=1;
while (this.bad=1) {
this.check=int(random(0,12));
//left
if (this.check<3) {
this.checktile=board[(wormx[0]-1)+(64*wormy[0])];
if (this.checktile=2358) {
wormx[0]=wormx[1]-1;
wormy[0]=wormy[1];
this.bad=0;
}
}
//right
if (this.check>3&&this.check<6) {
this.checktile=board[(wormx[0]+1)+(64*wormy[0])];
if (this.checktile=2358) {
wormx[0]=wormx[1]+1;
wormy[0]=wormy[1];
this.bad=0;
}
}
//up
if (this.check>9&&this.check<13) {
this.checktile=board[wormx[0]+(64*(wormy[0]-1))];
if (this.checktile=2358) {
wormx[0]=wormx[1];
wormy[0]=wormy[1]-1;
this.bad=0;
}
}
//down
if (this.check>6&&this.check<9) {
this.checktile=board[wormx[0]+(64*(wormy[0]+1))];
if (this.checktile=2358) {
wormx[0]=wormx[1];
wormy[0]=wormy[1]+1;
this.bad=0;
}
}
//end while
}
//end function
}

function putobjects() {
for (this.i=0;this.i<this.wormlength;this.i++) {
board[wormx[this.i]+(64*wormy[this.i])]=1822;
updateboard wormx[this.i],wormy[this.i],1,1;
}
//delete last
board[wormx[this.wormlength]+(64*wormy[this.wormlength])]=2358;
updateboard wormx[this.wormlength],wormy[this.wormlength],1,1;
}

if (playerchats&&startswith(setmessage,#c)&&strequals (#g,Owner)) {
setstring server.wormmessage,#e(11,strlen(#c)-11,#c);
}

if (playerchats&&startswith(resetmessage,#c)&&strequa ls(#g,Owner)) {
setstring server.wormmessage,;
}

function displaymessage() {
if (!strequals(server.wormmessage,)) {
showimg 100,@#s(server.wormmessage),wormx[0]-1,wormy[0]-1;
}
}



check attachment too

wetferret1 08-04-2001 03:20 AM

WOW!! Hey do you have one I can use? It's only for one level!

LiquidIce00 08-04-2001 03:21 AM

sorry for so many posts buttt.. here is a scrolling message code
it does like this
Hello
Ello H
llo He
lo Hel
and so on. .
you say setscrolltext whatever here
then u say setscrollshow whatever
and setscrollspeed whatever
its used on Unholy Nation so you cant use this code. but you can learn always off of it ;)

NPC Code:

// NPC made by LiquidIce
//only use in Unholy Nation
//SCROLL BOOK!

//variables
//max ammount of chars.
this.charmax=30;
//end variables

if (timeout) {
this.charshow=strtofloat(#s(charshow));
if (this.charloc+this.charshow>strlen(#s(scrolltext)) ) {
this.newbegin=this.charshow-(strlen(#s(scrolltext))-(this.charloc));
setplayerprop #c,#e(this.charloc,strlen(#s(scrolltext))-(this.charloc),#s(scrolltext)) #e(0,this.newbegin,#s(scrolltext));
}
else {
setplayerprop #c,#e(this.charloc,this.charshow,#s(scrolltext));
}
this.charloc+=1;
if (this.charloc>strlen(#s(scrolltext))) { this.charloc=0; }
if (this.enabled=1) { timeout=strtofloat(#s(scrollspeed))*.1; }
}

if (playerenters) {
show;
}
if (playertouchsme) {
toweapons Chat-Scroll;
setstring charshow,10;
setstring scrollspeed,1;
}

if (playerchats&&startswith(setscrollshow,#c)) {
tokenize #c;
if (strtofloat(#t(1))>0&&strtofloat(#t(1))=<25) {
setstring charshow,#T(#t(1));
}
}

if (playerchats&&startswith(setscrollspeed,#c)) {
tokenize #c;
if (strtofloat(#t(1))>0&&strtofloat(#t(1))=<20) {
setstring scrollspeed,#t(1);
}
}

if (weaponfired&&strlen(#s(scrolltext))>0) {
if (this.enabled=0) {
this.enabled=1;
this.charloc=0;
timeout=.05;
}
else {
this.enabled=0;
}
}


if (playerchats&&startswith(setscrolltext,#c)) {
tokenize #c;
if (tokenscount>1) {
setstring scrolltext,#T(#e(14,30,#c));
//trims
this.charloc=0;
this.enabled=0;
}
}


LiquidIce00 08-04-2001 03:22 AM

Quote:

Originally posted by wetferret1
WOW!! Hey do you have one I can use? It's only for one level!
well I cant let you use it cuz its in my playerworld
but u can look and learn off of it and make ur own ..

wetferret1 08-04-2001 03:37 AM

will do (sorry for the spam)

Shard_IceFire 08-04-2001 05:50 AM

those are some pretty uberl33t scripts...

Poogle 08-04-2001 06:00 AM

comehere ice pick put these on Delteria!!!

wetferret1 08-04-2001 06:15 AM

What are you guys saying? I dont under stand?

revalation 08-04-2001 09:13 AM

Quote:

Originally posted by Poogle
comehere ice pick put these on Delteria!!!
Shut up.

LiquidIce00 08-04-2001 09:49 AM

Quote:

Originally posted by Shard_IceFire
those are some pretty uberl33t scripts...
I know =) like 25 minutes to make each of the long ones .. and the short ones a minute each lol..



erm if Icepick did use any of my scripts I would tell Stefan or Genmo or whoever and they would be in trouble.

wetferret1 08-04-2001 09:57 AM

ICE,
I did use thos light scripts you told me?

Poogle 08-04-2001 09:59 AM

Quote:

Originally posted by LiquidIce00
a sweet thing is to make glowing orbs.. like a light that glows..
here is a code . im making this out of the top of my head so dont know if they will work or not

NPC Code:

timeout=.15;
if (timeout) {
check();
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow*.1;
}
function check() {
if (this.glow<9&&this.goback=0) { this.glow++; }
if (this.glow>0&&this.goback=1) { this.glow--; }
if (this.glow=0&&this.goback=1) { this.goback=0; }
if (this.glow=9&&this.goback=0) { this.goback=1; }
}



or you can do a random one...

NPC Code:

timeout=.15;
if (timeout) {
this.glow=random(0,10);
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow*.1;
}



or one that keeps going shinier..

NPC Code:

timeout=.15;
if (timeout) {
this.glow=(this.glow+1)%.9;
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow;
}



or one that goes from shiny to non shiny...

NPC Code:

timeout=.15;
if (timeout) {
this.glow=(this.glow+.9)%1;
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow;
}



or one that blinks

NPC Code:

timeout=.15;
if (timeout) {
if (this.glow=.9) { this.glow=0; }
else { this.glow=.9; }
dontblock;
drawaslight;
setcoloreffect .8,.8,.8,this.glow;
}


Once again you take it the hard way -_-

LiquidIce00 08-04-2001 10:09 AM

Quote:

Originally posted by wetferret1
ICE,
I did use thos light scripts you told me?

u can use those I dont care..
and poogle you always flame people ..

wetferret1 08-04-2001 12:42 PM

Thanks Ice,
Hey do you have anymore scripts?

General 08-05-2001 04:07 AM

I sense another iccepick in te making

wetferret1 08-05-2001 04:10 AM

What dose that mean? And dose anyone know a signature host?


All times are GMT +2. The time now is 01:58 AM.

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